}
protected:
- Fixed track; /* Track value for this record. */
+ HBFixed track; /* Track value for this record. */
NameID trackNameID; /* The 'name' table index for this track.
* (a short word or phrase like "loose"
* or "very tight") */
- NNOffsetTo<UnsizedArrayOf<FWORD> >
+ NNOffsetTo<UnsizedArrayOf<FWORD>>
valuesZ; /* Offset from start of tracking table to
* per-size tracking values for this track. */
const void *base) const
{
unsigned int sizes = nSizes;
- hb_array_t<const Fixed> size_table ((base+sizeTable).arrayZ, sizes);
+ hb_array_t<const HBFixed> size_table ((base+sizeTable).arrayZ, sizes);
float s0 = size_table[idx].to_float ();
float s1 = size_table[idx + 1].to_float ();
int get_tracking (const void *base, float ptem) const
{
- /* CoreText points are CSS pixels (96 per inch),
- * NOT typographic points (72 per inch).
- *
- * https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html
- */
- float csspx = ptem * 96.f / 72.f;
-
/*
* Choose track.
*/
if (!sizes) return 0.;
if (sizes == 1) return trackTableEntry->get_value (base, 0, sizes);
- hb_array_t<const Fixed> size_table ((base+sizeTable).arrayZ, sizes);
+ hb_array_t<const HBFixed> size_table ((base+sizeTable).arrayZ, sizes);
unsigned int size_index;
for (size_index = 0; size_index < sizes - 1; size_index++)
- if (size_table[size_index].to_float () >= csspx)
- break;
+ if (size_table[size_index].to_float () >= ptem)
+ break;
- return round (interpolate_at (size_index ? size_index - 1 : 0, csspx,
- *trackTableEntry, base));
+ return roundf (interpolate_at (size_index ? size_index - 1 : 0, ptem,
+ *trackTableEntry, base));
}
bool sanitize (hb_sanitize_context_t *c, const void *base) const
protected:
HBUINT16 nTracks; /* Number of separate tracks included in this table. */
HBUINT16 nSizes; /* Number of point sizes included in this table. */
- LOffsetTo<UnsizedArrayOf<Fixed>, false>
+ LOffsetTo<UnsizedArrayOf<HBFixed>, false>
sizeTable; /* Offset from start of the tracking table to
* Array[nSizes] of size values.. */
UnsizedArrayOf<TrackTableEntry>
hb_position_t advance_to_add = c->font->em_scalef_x (tracking);
foreach_grapheme (buffer, start, end)
{
- if (!(buffer->info[start].mask & trak_mask)) continue;
+ if (!(buffer->info[start].mask & trak_mask)) continue;
buffer->pos[start].x_advance += advance_to_add;
buffer->pos[start].x_offset += offset_to_add;
}
hb_position_t advance_to_add = c->font->em_scalef_y (tracking);
foreach_grapheme (buffer, start, end)
{
- if (!(buffer->info[start].mask & trak_mask)) continue;
+ if (!(buffer->info[start].mask & trak_mask)) continue;
buffer->pos[start].y_advance += advance_to_add;
buffer->pos[start].y_offset += offset_to_add;
}