Petri Posted December 11, 2006 Share Posted December 11, 2006 It seems we can't set tabs with VS. This would be quite useful, at least in my opinion. Quote Link to comment
_c_ Posted December 11, 2006 Share Posted December 11, 2006 Yes you can. Pref flag real 681 and 682. I didn't try to set them, give it a try and tell me if it works. And how it works. Orso Quote Link to comment
Petri Posted December 11, 2006 Author Share Posted December 11, 2006 (edited) 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 December 11, 2006 by Petri Quote Link to comment
_c_ Posted December 12, 2006 Share Posted December 12, 2006 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 Quote Link to comment
Petri Posted December 12, 2006 Author Share Posted December 12, 2006 Orso, the units are drawing units. In a "table" I set the tab to be 5500 mm! Quote Link to comment
_c_ Posted December 12, 2006 Share Posted December 12, 2006 Thank you Petri, nice to know. Orso Quote Link to comment
Petri Posted December 12, 2006 Author Share Posted December 12, 2006 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 Quote Link to comment
_c_ Posted December 12, 2006 Share Posted December 12, 2006 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 Quote Link to comment
Petri Posted December 12, 2006 Author Share Posted December 12, 2006 (edited) I assume I can use DOMENUTEXTBYNAME to convert an M to polylines, then if needed even to a group of lines. There I would have the height, ie Em. Edited December 12, 2006 by Petri Quote Link to comment
_c_ Posted December 12, 2006 Share Posted December 12, 2006 Petri, it is horrible. Quote Link to comment
Petri Posted December 13, 2006 Author Share Posted December 13, 2006 Yes, it would be nicer to query the font file... Alternatively, the users formats the output once, then the tabbing is stored in a text file. (I'd of course prefer to store it in the parameter record, but I can't get writing to thenm to work.) Quote Link to comment
MullinRJ Posted December 15, 2006 Share Posted December 15, 2006 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 Quote Link to comment
Petri Posted December 15, 2006 Author Share Posted December 15, 2006 Raymond, that is of course a better way - thanks! Quote Link to comment
Recommended Posts
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.