RMagick: get glyph metrics
I can't find out how to get all metrics of a given glyph with RMagick.
I know there is a get_type_metric开发者_运维知识库s method which gives the baseline, height, ascent, descent, etc, but I would also like to get the x-height, cap-height, bounding rectangle for a given glyph, etc. Is that possible?
Unfortunately, no, this is not possible. RMagick is a (nice) binding to the ImageMagick library, and ImageMagick does not provide the information you are requesting.
The only font metrics information available from ImageMagick is shown in this example:
Metrics: text: Test; width: 49.5; height: 29; ascent: 20; descent: -7; max advance: 30;
bounds: 0.5,-3 25,16; origin: 49,0; pixels per em: 24,24; underline position: -1.64062;
underline thickness: 0.78125
This is why get_type_metrics
only returns the information that it does.
精彩评论