mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:47:44 +00:00
LibPDF: Add some spec comments in Type0Font::initialize()
This commit is contained in:
parent
004e47df88
commit
fc9b2440bd
1 changed files with 3 additions and 1 deletions
|
@ -273,12 +273,14 @@ PDFErrorOr<void> Type0Font::initialize(Document* document, NonnullRefPtr<DictObj
|
|||
return Error { Error::Type::MalformedPDF, "invalid /Subtype for Type 0 font" };
|
||||
}
|
||||
|
||||
// PDF 1.7 spec, 5.6.3 CIDFonts, Glyph Metrics in CIDFonts, and TABLE 5.14 Entries in a CIDFont dictionary
|
||||
// "The DW entry defines the default width, which is used for all glyphs whose widths are not specified individually."
|
||||
u16 default_width = 1000;
|
||||
if (descendant_font->contains(CommonNames::DW))
|
||||
default_width = descendant_font->get_value(CommonNames::DW).to_int();
|
||||
|
||||
// "The W array allows the definition of widths for individual CIDs."
|
||||
HashMap<u16, u16> widths;
|
||||
|
||||
if (descendant_font->contains(CommonNames::W)) {
|
||||
auto widths_array = MUST(descendant_font->get_array(document, CommonNames::W));
|
||||
Optional<u16> pending_code;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue