Krita Source Code Documentation
Loading...
Searching...
No Matches
KoFFWWSConverter::Private Struct Reference

Public Member Functions

 Private ()
 

Public Attributes

KisForest< FontFamilyNodefontFamilyCollection
 fontFamilyCollection
 

Detailed Description

Definition at line 222 of file KoFFWWSConverter.cpp.

Constructor & Destructor Documentation

◆ Private()

KoFFWWSConverter::Private::Private ( )
inline

Definition at line 223 of file KoFFWWSConverter.cpp.

223{}

Member Data Documentation

◆ fontFamilyCollection

KisForest<FontFamilyNode> KoFFWWSConverter::Private::fontFamilyCollection

fontFamilyCollection

The main reason this WWS converter class exists, is because there's 3 major ways that font-families get sorted:

  1. RIBBI style, this means a single family can have a regular, a bold, an italic and a bold-italic.
  2. WWS style, which means that a single family can have variations in width, weight(bold), and slant (italic).
  3. Typographic style, which means a single family can have all sorts of variations, limited only by the designer's imagination.

In practice, this means that a single font file can have unique names for each of these three families, as different systems may only support a certain type. Because CSS only really has controls for WWS and RIBBI style, we need to untangle the font-families so we can identify the correct name for a given font within these restrictions.

For this purpose, we create a font-family collection tree that is sorted as such:

  1. Typographic
    1. WWS/RIBBI family
      1. Font file and identical alternates, the latter of which count when:
        • The file has the same family and sub family name (and same css values), which can happen when there's both type1 and opentype versions of a font. We prioritize opentype files here, but returning all these filenames means that the type1 files can be used during glyph-fallback.
        • The file is a bitmap font with different sizes. This in particular is so that usage will behave the exact same as an opentype file with multiple bitmap strikes.

This tree then allows us to search on all 3 entries, in particular their family names (and their localized variants), and will be able to fall-back on the other names if the name that the user selected is not the WWS/RIBBI name. (For example, an artist sets the name of the font family to "Amstelvar", which is the typographic name, but the WWS name is "Amstelvar Roman". This class will prioritize WWS values when searching, but still select the typographic name if it cannot match the wws name. Similarly, if a full font name (yes, that exists too) has been used, this will be prioritized).

Definition at line 256 of file KoFFWWSConverter.cpp.


The documentation for this struct was generated from the following file: