mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b=569770 part 5: gfxFT2FontBase::GetHintedGlyphWidth implementation r=jfkthame
--HG-- extra : rebase_source : 9770d596e7edf369f08f85a0598d470e07f7bbae
This commit is contained in:
parent
67bd437165
commit
011c9d94ae
@ -202,6 +202,15 @@ gfxFT2FontBase::GetFontTable(PRUint32 aTag)
|
||||
haveTable ? &buffer : nsnull);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
gfxFT2FontBase::GetHintedGlyphWidth(gfxContext *aCtx, PRUint16 aGID)
|
||||
{
|
||||
cairo_text_extents_t extents;
|
||||
GetGlyphExtents(aGID, &extents);
|
||||
// convert to 16.16 fixed point
|
||||
return NS_lround(0x10000 * extents.x_advance);
|
||||
}
|
||||
|
||||
PRBool
|
||||
gfxFT2FontBase::SetupCairoFont(gfxContext *aContext)
|
||||
{
|
||||
|
@ -61,6 +61,8 @@ public:
|
||||
virtual nsString GetUniqueName();
|
||||
virtual PRUint32 GetSpaceGlyph();
|
||||
virtual hb_blob_t *GetFontTable(PRUint32 aTag);
|
||||
virtual PRBool ProvidesHintedWidths() const { return PR_TRUE; }
|
||||
virtual PRInt32 GetHintedGlyphWidth(gfxContext *aCtx, PRUint16 aGID);
|
||||
|
||||
cairo_scaled_font_t *CairoScaledFont() { return mScaledFont; };
|
||||
virtual PRBool SetupCairoFont(gfxContext *aContext);
|
||||
|
@ -1007,6 +1007,8 @@ public:
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// The return value is interpreted as a horizontal advance in 16.16 fixed
|
||||
// point format.
|
||||
virtual PRInt32 GetHintedGlyphWidth(gfxContext *aCtx, PRUint16 aGID) {
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user