Question

In adobe's pdf 1.7 page 241 you can see a small difference between the glyph bounding box and the glyph's origin. Any idea why there is this difference?

This question is related to another question

Was it helpful?

Solution

Concerning any idea why there is this difference --- the reason why there is that difference between the glyph bounding box and the glyph's origin can be derived from the text right below that graphic:

Glyph metrics

The glyph origin is the point (0, 0) in the glyph coordinate system. Tj and other text-showing operators shall position the origin of the first glyph to be painted at the origin of text space.

[...]

The glyph displacement is the distance from the glyph’s origin to the point at which the origin of the next glyph should normally be placed when painting the consecutive glyphs of a line of text.

(Figure 39, section 9.2.4 of ISO 32000-1).

If you have consecutive glyphs, therefore, the second one is set the first one's width after the origin of that glyph. If the bounding box filled all this width, the consecutive glyphs would likely touch which is not desired.

Thus, the bounding box cannot fill all the width (aka horizontal displacement), some difference is required.

Furthermore the desired gap between two consecutive glyphs depends on both glyphs; to look good, a glyph with only a small bit of one side of its bounding box filled may need less gap to that side than a glyph having that side of its bounding box filled completely. So both to the left and to the right the glyph has to be enabled to express its requirement for distance to the adjacent glyph.

Thus, the difference could not be concentrated on the right side (after the bounding box) only.

This implies that the glyph origin cannot be forced to be on the left border of the bounding box.

BTW, depending on the font there may even be reason for overlapping bounding boxes. Thus, in some cases you might come across a glyph whose origin is in the interior of the bounding box...

OTHER TIPS

That's not Adobe's PDF reference, that's the ISO reference, please be careful distinguishing the two. The diagram is on page 394 of the Adobe PDF Reference Manual version 1.7.

Its not obvious to me what you think the problem is, the bounding box simply doesn't start at 0,0.

The difference is given by llx - 0 because the glyph origin is always at 0,0

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top