зеркало из https://github.com/mozilla/pjs.git
Bug 5304 -- we now assume 96dpi (we ignore the X server).
Also fixed problem with fonts when no font containing the requested glyph could be found. (Thanks to Kipp for discovering this.)
This commit is contained in:
Родитель
c135a20cca
Коммит
32d98077c3
|
@ -66,6 +66,10 @@ NS_IMETHODIMP nsDeviceContextGTK::Init(nsNativeWidget aNativeWidget)
|
|||
|
||||
mWidget = aNativeWidget;
|
||||
|
||||
#define IGNORE_X_SERVER_DPI
|
||||
#ifdef IGNORE_X_SERVER_DPI
|
||||
nscoord dpi = 96;
|
||||
#else /* IGNORE_X_SERVER_DPI */
|
||||
// Compute dpi of display
|
||||
float screenWidth = float(::gdk_screen_width());
|
||||
float screenWidthIn = float(::gdk_screen_width_mm()) / 25.4f;
|
||||
|
@ -75,6 +79,7 @@ NS_IMETHODIMP nsDeviceContextGTK::Init(nsNativeWidget aNativeWidget)
|
|||
if (dpi < 84) dpi = 72;
|
||||
else if (dpi < 108) dpi = 96;
|
||||
else if (dpi < 132) dpi = 120;
|
||||
#endif /* IGNORE_X_SERVER_DPI */
|
||||
|
||||
mTwipsToPixels = float(dpi) / float(NSIntPointsToTwips(72));
|
||||
mPixelsToTwips = 1.0f / mTwipsToPixels;
|
||||
|
|
|
@ -2138,12 +2138,9 @@ nsFontMetricsGTK::FindFont(PRUnichar aChar)
|
|||
return search.mFont;
|
||||
}
|
||||
|
||||
// XXX Just use any font that contains 'a' for now.
|
||||
// XXX Just return nsnull for now.
|
||||
// Need to draw boxes eventually. Or pop up dialog like plug-in dialog.
|
||||
search.mChar = 'a';
|
||||
PL_HashTableEnumerateEntries(gFamilies, SearchFamily, &search);
|
||||
|
||||
return search.mFont;
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
gint
|
||||
|
|
Загрузка…
Ссылка в новой задаче