Jump to content
Developer Wiki and Function Reference Links ×

Text block formatting (tabs)


Petri

Recommended Posts

Thanks, Orso. Seems to work with either.

The value is in world dimensions, so there's an interesting exercise in determining how much space one needs. Converting an M to a polyline and measuring that, then making assumptions on the character measurements (in Ems) of some likely fonts? Nah, I'll hard-code Courier and let the users worry.

Edited by Petri
Link to comment

Yes the two flags seem to return the same attribute.

Petri, I could think they are points:

1 point = 1/72 in

1 point = 1/1828,8 mm = 1/(25.4*72) mm= 0,000547 mm

Since I'm awful in math, and I cannot find at the very moment my own snippet for this, I ask the intervention of real Gandalf for giving you a truly optimized conversion routine. Including UPI. Raymoooondd.......

Orso smile.gif

Link to comment

Orso,

I'm investigating the Em-measurement & average width of characters in "normal" typefaces. Unfortunately, the people I know who are currently in typography do not seem to know whan an Em is...

The concept is this:

- measure Em of the user's font in current scale

- calculate the max number of characters in source data

- calculate the required tab spacing using the average width in Ems

- set the object variable to be as needed

Link to comment

Yes, I'm very interested in this too.

The problem by this routine development is that you must vectorize a M in order to get its width (supposing you search for a clean em). If you find a trick to avoid this, I'd be very glad to know.

I don't think VS allows you to do it. The SDK should be the way.

Orso

Link to comment

Petri,

For a rough estimate of the Em Space of a Font, create a textblock of the chatacter 'M' at the point size you desire and use GetTextWidth(). Delete the textblock when done. If I'm not mistaken, 'W' is wider than 'M'. Either width should get you close enough to do what you want.

Raymond

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...