Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6876945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:32:27+00:00 2026-05-27T04:32:27+00:00

I’m looking for PostScript code that estimates a PostScript font’s height (room for ascender)

  • 0

I’m looking for PostScript code that estimates a PostScript font’s height (room for ascender) and depth (room for descender). Could a font’s bounding box (FontBBox) be used for this?`

Here is some background for my question: glyphs of a font are sitting on a baseline. Obviously glyphs with descenders will reach below the baseline and I want to know how far below the baseline descenders can reach such that I can provide sufficient space in a layout.

I have seen PostScript code that renders a given string to check its dimension. I’m rather interested in a general answer for a given font.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:32:28+00:00Added an answer on May 27, 2026 at 4:32 am

    Well, you’ve already discovered the two “shortcuts”. The FontBBox gives the bounding box of all the glyphs in the font superposed together. false charpath flattenpath pathbbox gives the box for a specified string.

    For a Type 3 (user-defined) font this is all you can reaonably expect to do; but for the more-popular Type 1 fonts, there is a wealth of metric information both in the font and in a “metrics” file (for other applications).

    But this is the part I don’t know very well. So I’m going to read-up (in the Adobe Type 1 manual) and expand this answer later.

    Edit: Actually, it looks like these may be the best ways in general.

    There is an array of vertical alignment values in a Type 1 font, in the /Private dictionary, under the name /BlueValues; but there is no guarantee that the font honors them. The first number in the array is the baseline overshoot; this is the bottom edge of letters like ‘O’ which dip below the baseline. And the largest value in the array will be either the ascender-height overshoot or the cap-height overshoot (whichever is higher). But any individual character may be plotted without regard to these values (hence, no guarantee).

    On the other hand, the FontBBox itself may reflect the bounding box of any “special” characters present in the font, whether or not they’re accessible through the encoding vector (ie. you can’t show them, but must glyphshow them).

    So the best bet would probably be to take the pathbbox of a string of all the characters you intend to use. This would ignore the contribution of any other characters that may be present but are irrelevant to your purpose. And don’t forget to flattenpath to remove the control points from the curves (which may be far outside the “real” bounding box).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.