Old-pango code that should be correct. r=vlad

git-svn-id: svn://10.0.0.236/trunk@187802 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org
2006-01-19 01:19:06 +00:00
parent f49b9775c6
commit 96c8afdbbb

View File

@@ -184,6 +184,21 @@ static void InitPangoLib()
// leak lib deliberately
}
static double
GetXftDPI(void)
{
char *val = XGetDefault(GDK_DISPLAY(), "Xft", "dpi");
if (val) {
char *e;
double d = strtod(val, &e);
if (e != val)
return round(d);
}
return 0;
}
static void
MOZ_pango_font_description_set_absolute_size(PangoFontDescription *desc,
double size)
@@ -191,8 +206,8 @@ MOZ_pango_font_description_set_absolute_size(PangoFontDescription *desc,
if (PTR_pango_font_description_set_absolute_size) {
PTR_pango_font_description_set_absolute_size(desc, size);
} else {
// Fake it! Assume the server DPI is 96. If it isn't, too bad
pango_font_description_set_size(desc, (gint)(size * 72.0/96.0));
pango_font_description_set_size(desc,
(gint)(size * 72.0 / GetXftDPI()));
}
}
#else