alcinnz,
@alcinnz@floss.social avatar

Much of what you see in PDFs is text, rendered via some font. So how does PDF (specifically LibPoppler's implementation) handle fonts?

It gathers the fonts into a FontDict class (indexed presumably by numeric ID). With fonts themselves storing various textual names, Ref into the PDF file, weight & stretch (enums), the encoding, bitflags, transformation matrix, bbox, width for missing chars, ascent & descent dimensions, flags whether it can convert to/from Unicode, & flags validity.

1/2?

alcinnz,
@alcinnz@floss.social avatar

There's a couple subclasses for 8bit fonts or (incorporating geometry structs) character-ID fonts, both adding additional properties.

You can ask fonts for their location, returning an enum for whether the font's embedded, the font's encoding, Ref to the font in the file, filepath, ID in the fontfile, & a fallback font index.

The implementation is, beyond the usual heavy focus on parsing & accessors, implements set operations upon charsets & lookups of built-in fonts.

2/2.1!

alcinnz,
@alcinnz@floss.social avatar

This all wraps a vendored "FoFi" library I'll cover later, which presumably wraps FreeType. GPerf is used to speed up lookup of builtin fonts, which are spread across dataheaders.

2.1/2.1 Fin for today! Tomorrow: Skim over what I haven't covered! After that: The vendored libs!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • rosin
  • Durango
  • thenastyranch
  • ngwrru68w68
  • InstantRegret
  • DreamBathrooms
  • modclub
  • magazineikmin
  • Youngstown
  • everett
  • ethstaker
  • slotface
  • mdbf
  • kavyap
  • JUstTest
  • osvaldo12
  • GTA5RPClips
  • cisconetworking
  • provamag3
  • khanakhh
  • tacticalgear
  • cubers
  • Leos
  • normalnudes
  • megavids
  • tester
  • anitta
  • lostlight
  • All magazines