• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Getting point size from pixels (to fit in a rectangle) - c.c++ sdk

New Here ,
Dec 20, 2022 Dec 20, 2022

Copy link to clipboard

Copied

When passed in a rectangle for an annotation, I want to create an appearance stream that has a point size that will mostly fill the rectangle. I calculate a smaller one that I want to fill. I have it working fine of I just use an arbitrary point size, but my first few attempts at computing it are failing.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

149

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 20, 2022 Dec 20, 2022

Copy link to clipboard

Copied

LATEST

There is a big challenge he because there is not a fixed connection between point size and filling a space with text. Most (not all) fonts are designed so they can be set with 0 leading (no space between lines) without overlap. This means there is room above the characters for descenders from g, j etc. filling a space will depend on the characters and font used, and is more an exercise in geometry. You could try examining the font metrics in detail but bear in mind the scaling has to change if the characters used change. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines