Krita Source Code Documentation
Loading...
Searching...
No Matches
FontFamilySizeInfo Struct Reference

The FontFamilySizeInfo class Some font-families have different designs for different sizes. These are largely differences in weight, spacing and small glyph changes. There's four places opentype stores the design size information: More...

Public Member Functions

bool compare (const FontFamilySizeInfo &other)
 
QString debugInfo () const
 

Public Attributes

qreal designSize = 0
 
qreal high = -1
 
bool isSet = false
 
QHash< QLocale, QString > localizedLabels
 
qreal low = -1
 
bool os2table = false
 Whether the size info is set.
 
int subFamilyID = 0
 Whether this is using the OS2 table or the GPOS Size feature.
 

Detailed Description

The FontFamilySizeInfo class Some font-families have different designs for different sizes. These are largely differences in weight, spacing and small glyph changes. There's four places opentype stores the design size information:

  1. Different bitmap strikes in the font file. Bitmap fonts do the same.
  2. The OS2 table entry.
  3. The 'size' opentype feature.
  4. The 'opsz' axes in either variable fonts or the stat table.

Of these, 1 and 4 are supported properly, but we need to keep track of 2 and 3 as well, to ensure that these fonts are still selectable in the font picker.

Definition at line 31 of file KoFFWWSConverter.cpp.

Member Function Documentation

◆ compare()

bool FontFamilySizeInfo::compare ( const FontFamilySizeInfo & other)
inline

Definition at line 48 of file KoFFWWSConverter.cpp.

48 {
49 if (isSet != other.isSet) return false;
50 if (os2table != other.os2table) {
51 return false;
52 } else if (os2table) {
53 return qFuzzyCompare(low, other.low) && qFuzzyCompare(high, other.high);
54 } else {
55 return qFuzzyCompare(designSize, other.designSize);
56 }
57 }
static bool qFuzzyCompare(half p1, half p2)
bool os2table
Whether the size info is set.

References designSize, high, isSet, low, os2table, and qFuzzyCompare().

◆ debugInfo()

QString FontFamilySizeInfo::debugInfo ( ) const
inline

Definition at line 40 of file KoFFWWSConverter.cpp.

40 {
41 QString label;
42 if (!localizedLabels.isEmpty()) {
43 label = localizedLabels.value(QLocale(QLocale::English), localizedLabels.values().first());
44 }
45 return QString("Optical Size Info: OS2=%1, label: %2, min: %3, max: %4, designSize: %5").arg(os2table? "true": "false").arg(label).arg(low).arg(high).arg(designSize);
46 }
QHash< QLocale, QString > localizedLabels

References designSize, high, localizedLabels, low, and os2table.

Member Data Documentation

◆ designSize

qreal FontFamilySizeInfo::designSize = 0

Definition at line 38 of file KoFFWWSConverter.cpp.

◆ high

qreal FontFamilySizeInfo::high = -1

Definition at line 37 of file KoFFWWSConverter.cpp.

◆ isSet

bool FontFamilySizeInfo::isSet = false

Definition at line 32 of file KoFFWWSConverter.cpp.

◆ localizedLabels

QHash<QLocale, QString> FontFamilySizeInfo::localizedLabels

Definition at line 39 of file KoFFWWSConverter.cpp.

◆ low

qreal FontFamilySizeInfo::low = -1

Definition at line 36 of file KoFFWWSConverter.cpp.

◆ os2table

bool FontFamilySizeInfo::os2table = false

Whether the size info is set.

Definition at line 33 of file KoFFWWSConverter.cpp.

◆ subFamilyID

int FontFamilySizeInfo::subFamilyID = 0

Whether this is using the OS2 table or the GPOS Size feature.

Definition at line 34 of file KoFFWWSConverter.cpp.


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