Lines Matching refs:metrics
103 static bool can_embed(const SkAdvancedTypefaceMetrics& metrics) { in can_embed() argument
104 return !SkToBool(metrics.fFlags & SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag); in can_embed()
120 std::unique_ptr<SkAdvancedTypefaceMetrics> metrics = typeface->getAdvancedMetrics(); in GetMetrics() local
121 if (!metrics) { in GetMetrics()
122 metrics = skstd::make_unique<SkAdvancedTypefaceMetrics>(); in GetMetrics()
125 if (0 == metrics->fStemV || 0 == metrics->fCapHeight) { in GetMetrics()
130 if (0 == metrics->fStemV) { in GetMetrics()
140 metrics->fStemV = stemV; in GetMetrics()
142 if (0 == metrics->fCapHeight) { in GetMetrics()
151 metrics->fCapHeight = SkToS16(SkScalarRoundToInt(capHeight / 2)); in GetMetrics()
154 return canon->fTypefaceMetrics.set(id, std::move(metrics))->get(); in GetMetrics()
170 SkAdvancedTypefaceMetrics::FontType SkPDFFont::FontType(const SkAdvancedTypefaceMetrics& metrics) { in FontType() argument
171 if (SkToBool(metrics.fFlags & SkAdvancedTypefaceMetrics::kMultiMaster_FontFlag) || in FontType()
172 SkToBool(metrics.fFlags & SkAdvancedTypefaceMetrics::kNotEmbeddable_FontFlag)) { in FontType()
176 return metrics.fType; in FontType()
197 const SkAdvancedTypefaceMetrics& metrics = *fontMetrics; in GetFontResource() local
198 SkAdvancedTypefaceMetrics::FontType type = SkPDFFont::FontType(metrics); in GetFontResource()
242 const SkAdvancedTypefaceMetrics& metrics, in add_common_font_descriptor_entries() argument
245 descriptor->insertName("FontName", metrics.fPostScriptName); in add_common_font_descriptor_entries()
246 descriptor->insertInt("Flags", (size_t)(metrics.fStyle | kPdfSymbolic)); in add_common_font_descriptor_entries()
248 scaleFromFontUnits(metrics.fAscent, emSize)); in add_common_font_descriptor_entries()
250 scaleFromFontUnits(metrics.fDescent, emSize)); in add_common_font_descriptor_entries()
252 scaleFromFontUnits(metrics.fStemV, emSize)); in add_common_font_descriptor_entries()
254 scaleFromFontUnits(metrics.fCapHeight, emSize)); in add_common_font_descriptor_entries()
255 descriptor->insertInt("ItalicAngle", metrics.fItalicAngle); in add_common_font_descriptor_entries()
257 SkPDFMakeArray(scaleFromFontUnits(metrics.fBBox.left(), emSize), in add_common_font_descriptor_entries()
258 scaleFromFontUnits(metrics.fBBox.bottom(), emSize), in add_common_font_descriptor_entries()
259 scaleFromFontUnits(metrics.fBBox.right(), emSize), in add_common_font_descriptor_entries()
260 scaleFromFontUnits(metrics.fBBox.top(), emSize))); in add_common_font_descriptor_entries()
293 const SkAdvancedTypefaceMetrics& metrics = *metricsPtr; in emit_subset_type0() local
294 SkASSERT(can_embed(metrics)); in emit_subset_type0()
301 add_common_font_descriptor_entries(descriptor.get(), metrics, emSize , 0); in emit_subset_type0()
314 if (!SkToBool(metrics.fFlags & in emit_subset_type0()
319 metrics.fFontName.c_str(), ttcIndex); in emit_subset_type0()
359 newCIDFont->insertName("BaseFont", metrics.fPostScriptName); in emit_subset_type0()
395 fontDict.insertName("BaseFont", metrics.fPostScriptName); in emit_subset_type0()
614 if (const SkAdvancedTypefaceMetrics* metrics = SkPDFFont::GetMetrics(typeface, doc)) { in type3_descriptor() local
616 descriptor.insertName("FontName", metrics->fPostScriptName); in type3_descriptor()
617 descriptor.insertInt("ItalicAngle", metrics->fItalicAngle); in type3_descriptor()
618 fontDescriptorFlags |= (int32_t)metrics->fStyle; in type3_descriptor()
621 if (metrics->fCapHeight != 0) { descriptor.insertInt("CapHeight", metrics->fCapHeight); } in type3_descriptor()
622 if (metrics->fStemV != 0) { descriptor.insertInt("StemV", metrics->fStemV); } in type3_descriptor()
783 const SkAdvancedTypefaceMetrics* metrics = SkPDFFont::GetMetrics(typeface, doc); in CanEmbedTypeface() local
784 return metrics && can_embed(*metrics); in CanEmbedTypeface()