17rust::Box<::fontations_ffi::BridgeFontRef> make_bridge_font_ref(
sk_sp<SkData> fontData,
19 rust::Slice<const uint8_t> slice{fontData->
bytes(), fontData->
size()};
20 return fontations_ffi::make_font_ref(slice, index);
33 rust::Slice<const uint8_t> slice{fontData->
bytes(), fontData->
size()};
34 ::std::uint32_t num_fonts;
35 if (!fontations_ffi::font_or_collection(slice, num_fonts)) {
38 *numFaces = num_fonts == 0 ? 1 : num_fonts;
44 int* numInstances)
const {
45 rust::Box<fontations_ffi::BridgeFontRef> fontRef =
48 if (!fontations_ffi::font_ref_is_valid(*fontRef)) {
66 rust::Box<fontations_ffi::BridgeFontRef> fontRef =
68 if (!fontations_ffi::font_ref_is_valid(*fontRef)) {
72 if (
name !=
nullptr) {
73 rust::String readFamilyName = fontations_ffi::family_name(*fontRef);
74 *
name =
SkString(readFamilyName.data(), readFamilyName.size());
77 if (style !=
nullptr) {
78 rust::Slice<const fontations_ffi::SkiaDesignCoordinate> coordinates;
79 rust::Box<fontations_ffi::BridgeNormalizedCoords> normalizedCoords =
80 resolve_into_normalized_coords(*fontRef, coordinates);
81 fontations_ffi::BridgeFontStyle fontStyle;
82 if (fontations_ffi::get_font_style(*fontRef, *normalizedCoords, fontStyle)) {
89 if (isFixedPitch !=
nullptr) {
90 *isFixedPitch =
false;
const uint8_t * bytes() const
static sk_sp< SkData > MakeFromStream(SkStream *, size_t size)
~SkFontScanner_Fontations() override
SkFontScanner_Fontations()
bool scanInstance(SkStreamAsset *stream, int faceIndex, int instanceIndex, SkString *name, SkFontStyle *style, bool *isFixedPitch, AxisDefinitions *axes) const override
bool scanFile(SkStreamAsset *stream, int *numFaces) const override
bool scanFace(SkStreamAsset *stream, int faceIndex, int *numInstances) const override
static constexpr SkFontStyle Normal()
DEF_SWITCHES_START aot vmservice shared library name