提交 b1b812c5 编写于 作者: V vadim

8074871: Adjust device table handling

Reviewed-by: prr, srl, mschoene
上级 b0312ba4
......@@ -44,21 +44,27 @@ void AnchorTable::getAnchor(const LETableReference &base, LEGlyphID glyphID, con
case 1:
{
LEReferenceTo<Format1AnchorTable> f1(base, success);
f1->getAnchor(f1, fontInstance, anchor, success);
if (LE_SUCCESS(success)) {
f1->getAnchor(f1, fontInstance, anchor, success);
}
break;
}
case 2:
{
LEReferenceTo<Format2AnchorTable> f2(base, success);
f2->getAnchor(f2, glyphID, fontInstance, anchor, success);
if (LE_SUCCESS(success)) {
f2->getAnchor(f2, glyphID, fontInstance, anchor, success);
}
break;
}
case 3:
{
LEReferenceTo<Format3AnchorTable> f3(base, success);
f3->getAnchor(f3, fontInstance, anchor, success);
if (LE_SUCCESS(success)) {
f3->getAnchor(f3, fontInstance, anchor, success);
}
break;
}
......@@ -66,7 +72,9 @@ void AnchorTable::getAnchor(const LETableReference &base, LEGlyphID glyphID, con
{
// unknown format: just use x, y coordinate, like format 1...
LEReferenceTo<Format1AnchorTable> f1(base, success);
f1->getAnchor(f1, fontInstance, anchor, success);
if (LE_SUCCESS(success)) {
f1->getAnchor(f1, fontInstance, anchor, success);
}
break;
}
}
......@@ -112,16 +120,18 @@ void Format3AnchorTable::getAnchor(const LEReferenceTo<Format3AnchorTable> &base
if (dtxOffset != 0) {
LEReferenceTo<DeviceTable> dt(base, success, dtxOffset);
le_int16 adjx = dt->getAdjustment(dt, (le_int16) fontInstance->getXPixelsPerEm(), success);
pixels.fX += adjx;
if (LE_SUCCESS(success)) {
le_int16 adjx = dt->getAdjustment(dt, (le_int16) fontInstance->getXPixelsPerEm(), success);
pixels.fX += adjx;
}
}
if (dtyOffset != 0) {
LEReferenceTo<DeviceTable> dt(base, success, dtyOffset);
le_int16 adjy = dt->getAdjustment(dt, (le_int16) fontInstance->getYPixelsPerEm(), success);
pixels.fY += adjy;
if (LE_SUCCESS(success)) {
le_int16 adjy = dt->getAdjustment(dt, (le_int16) fontInstance->getYPixelsPerEm(), success);
pixels.fY += adjy;
}
}
fontInstance->pixelsToUnits(pixels, anchor);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册