mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1029307 - use fixed subscript/superscript offset ratio instead of font metric values. r=heycam
This commit is contained in:
parent
9c0a2214db
commit
1e79307a4f
@ -162,13 +162,15 @@ nsFontMetrics::XHeight()
|
||||
nscoord
|
||||
nsFontMetrics::SuperscriptOffset()
|
||||
{
|
||||
return ROUND_TO_TWIPS(GetMetrics().superscriptOffset);
|
||||
return ROUND_TO_TWIPS(GetMetrics().emHeight *
|
||||
NS_FONT_SUPERSCRIPT_OFFSET_RATIO);
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsFontMetrics::SubscriptOffset()
|
||||
{
|
||||
return ROUND_TO_TWIPS(GetMetrics().subscriptOffset);
|
||||
return ROUND_TO_TWIPS(GetMetrics().emHeight *
|
||||
NS_FONT_SUBSCRIPT_OFFSET_RATIO);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -196,4 +196,8 @@ enum {
|
||||
#define NS_FONT_VARIANT_POSITION_SUPER 1
|
||||
#define NS_FONT_VARIANT_POSITION_SUB 2
|
||||
|
||||
// based on fixed offset values used within WebKit
|
||||
#define NS_FONT_SUBSCRIPT_OFFSET_RATIO (0.20)
|
||||
#define NS_FONT_SUPERSCRIPT_OFFSET_RATIO (0.34)
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user