mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
tweaked x-height guess for true-type fonts
This commit is contained in:
parent
7d56abdf32
commit
bcb947be7e
@ -232,7 +232,7 @@ nsFontMetricsWin::RealizeFont()
|
||||
|
||||
if (0 < ::GetOutlineTextMetrics(dc, sizeof(oMetrics), &oMetrics)) {
|
||||
// mXHeight = NSToCoordRound(oMetrics.otmsXHeight * dev2app); XXX not really supported on windows
|
||||
mXHeight = NSToCoordRound((float)metrics.tmAscent * dev2app * 0.56f); // 56% of ascent
|
||||
mXHeight = NSToCoordRound((float)metrics.tmAscent * dev2app * 0.52f); // 52% of ascent, best average for true type
|
||||
mSuperscriptOffset = NSToCoordRound(oMetrics.otmptSuperscriptOffset.y * dev2app);
|
||||
mSubscriptOffset = NSToCoordRound(oMetrics.otmptSubscriptOffset.y * dev2app);
|
||||
|
||||
@ -245,7 +245,7 @@ nsFontMetricsWin::RealizeFont()
|
||||
// Make a best-effort guess at extended metrics
|
||||
// this is based on general typographic guidelines
|
||||
::GetTextMetrics(dc, &metrics);
|
||||
mXHeight = NSToCoordRound((float)metrics.tmAscent * dev2app * 0.56f); // 56% of ascent
|
||||
mXHeight = NSToCoordRound((float)metrics.tmAscent * dev2app * 0.56f); // 56% of ascent, best guess for non-true type
|
||||
mSuperscriptOffset = mXHeight; // XXX temporary code!
|
||||
mSubscriptOffset = mXHeight; // XXX temporary code!
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user