mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 475968. Pad out the glyph extents of Windows text to account for possible antialiased pixels outside the regular bounds. r=roc
--HG-- extra : rebase_source : 25f20e31c45c26dcd0f83ea7a5d90800ead28ba0
This commit is contained in:
parent
310e2bcc62
commit
928d70795d
@ -1138,8 +1138,24 @@ gfxWindowsFont::Measure(gfxTextRun *aTextRun,
|
||||
}
|
||||
}
|
||||
|
||||
return gfxFont::Measure(aTextRun, aStart, aEnd,
|
||||
aBoundingBoxType, aRefContext, aSpacing);
|
||||
gfxFont::RunMetrics metrics = gfxFont::Measure(aTextRun, aStart, aEnd,
|
||||
aBoundingBoxType, aRefContext,
|
||||
aSpacing);
|
||||
|
||||
// if aBoundingBoxType is LOOSE_INK_EXTENTS
|
||||
// and the underlying cairo font may be antialiased,
|
||||
// we can't trust Windows to have considered all the pixels
|
||||
// so we need to add "padding" to the bounds.
|
||||
// (see bugs 475968, 439831, compare also bug 445087)
|
||||
if (aBoundingBoxType == LOOSE_INK_EXTENTS &&
|
||||
mAntialiasOption != CAIRO_ANTIALIAS_NONE &&
|
||||
metrics.mBoundingBox.size.width > 0) {
|
||||
const PRUint32 appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit();
|
||||
metrics.mBoundingBox.pos.x -= appUnitsPerDevUnit;
|
||||
metrics.mBoundingBox.size.width += 3 * appUnitsPerDevUnit;
|
||||
}
|
||||
|
||||
return metrics;
|
||||
}
|
||||
|
||||
FontEntry*
|
||||
|
@ -1,5 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
td { padding: 3px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tbody style="height:200px; overflow:auto;">
|
||||
|
@ -1,5 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
td { padding: 3px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tbody style="height:200px;">
|
||||
|
@ -1,4 +1,9 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
td { padding: 3px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tbody style="height:200px; overflow:auto;">
|
||||
|
@ -1,4 +1,9 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">
|
||||
td { padding: 3px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tbody style="height:200px;">
|
||||
|
Loading…
Reference in New Issue
Block a user