mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "sky/engine/core/css/BinaryDataFontFaceSource.h"
|
|
|
|
#include "sky/engine/platform/SharedBuffer.h"
|
|
#include "sky/engine/platform/fonts/FontCustomPlatformData.h"
|
|
#include "sky/engine/platform/fonts/FontDescription.h"
|
|
#include "sky/engine/platform/fonts/SimpleFontData.h"
|
|
|
|
namespace blink {
|
|
|
|
BinaryDataFontFaceSource::BinaryDataFontFaceSource(SharedBuffer* data)
|
|
: m_customPlatformData(FontCustomPlatformData::create(data))
|
|
{
|
|
}
|
|
|
|
BinaryDataFontFaceSource::~BinaryDataFontFaceSource()
|
|
{
|
|
}
|
|
|
|
bool BinaryDataFontFaceSource::isValid() const
|
|
{
|
|
return m_customPlatformData;
|
|
}
|
|
|
|
PassRefPtr<SimpleFontData> BinaryDataFontFaceSource::createFontData(const FontDescription& fontDescription)
|
|
{
|
|
return SimpleFontData::create(
|
|
m_customPlatformData->fontPlatformData(fontDescription.effectiveFontSize(),
|
|
fontDescription.isSyntheticBold(), fontDescription.isSyntheticItalic(),
|
|
fontDescription.orientation(), fontDescription.widthVariant()), CustomFontData::create());
|
|
}
|
|
|
|
} // namespace blink
|