|
|
@ -19,7 +19,7 @@ namespace Avalonia.Skia |
|
|
private readonly SKTypeface _typeface; |
|
|
private readonly SKTypeface _typeface; |
|
|
private readonly NameTable _nameTable; |
|
|
private readonly NameTable _nameTable; |
|
|
private readonly OS2Table? _os2Table; |
|
|
private readonly OS2Table? _os2Table; |
|
|
private readonly HorizontalHeadTable _hhTable; |
|
|
private readonly HorizontalHeadTable? _hhTable; |
|
|
private IReadOnlyList<OpenTypeTag>? _supportedFeatures; |
|
|
private IReadOnlyList<OpenTypeTag>? _supportedFeatures; |
|
|
|
|
|
|
|
|
public GlyphTypefaceImpl(SKTypeface typeface, FontSimulations fontSimulations) |
|
|
public GlyphTypefaceImpl(SKTypeface typeface, FontSimulations fontSimulations) |
|
|
@ -38,9 +38,9 @@ namespace Avalonia.Skia |
|
|
_os2Table = OS2Table.Load(this); |
|
|
_os2Table = OS2Table.Load(this); |
|
|
_hhTable = HorizontalHeadTable.Load(this); |
|
|
_hhTable = HorizontalHeadTable.Load(this); |
|
|
|
|
|
|
|
|
int ascent; |
|
|
var ascent = 0; |
|
|
int descent; |
|
|
var descent = 0; |
|
|
int lineGap; |
|
|
var lineGap = 0; |
|
|
|
|
|
|
|
|
if (_os2Table != null && (_os2Table.FontStyle & OS2Table.FontStyleSelection.USE_TYPO_METRICS) != 0) |
|
|
if (_os2Table != null && (_os2Table.FontStyle & OS2Table.FontStyleSelection.USE_TYPO_METRICS) != 0) |
|
|
{ |
|
|
{ |
|
|
@ -50,9 +50,12 @@ namespace Avalonia.Skia |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
ascent = -_hhTable.Ascender; |
|
|
if (_hhTable != null) |
|
|
descent = -_hhTable.Descender; |
|
|
{ |
|
|
lineGap = _hhTable.LineGap; |
|
|
ascent = -_hhTable.Ascender; |
|
|
|
|
|
descent = -_hhTable.Descender; |
|
|
|
|
|
lineGap = _hhTable.LineGap; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (_os2Table != null && (ascent == 0 || descent == 0)) |
|
|
if (_os2Table != null && (ascent == 0 || descent == 0)) |
|
|
|