Hallo plc-user
I think I worded things in a way that did not translate properly for someone who is not a native English speaker. Sorry about that, I will try and word things better to make it more clear.
The current code is my first attempt and properly handling the text sizing, and text scaling over what Antonio had with just a fixed 12pt font. I based the conversion of the text size from real world units (which the text height is stored as in dxf) to font points using the defined definition of 1pt = 1/72 inch. In the couple of drawings I tested this scaling looked OK, but I knew it needed more testing and verification. I checked it in because it was already better than what was there. Perhaps I need to do a better job and work at some of these features in branches instead of on master so people don't think the checked in code is fully functional, however you testing against it and provided these files is very useful feedback for me to fix problems.
When you brought this up and provided the Schriftgroessen file I checked against some online calculators converting mm to pt to verify that I had done the math correctly in my code. Based on the conversion of 1pt = 1/72 inch, I did do the match correctly in my code, but this conversion factor clearly does not provide good results, after testing against some more files.
So the question is what conversion factor do I need to use? In the Schriftgoessen file you provided, if I had assumed that 1mm = 1pt and then scaled it with the mm->px conversion of 2x, that actually would have been more accurate. It looks like it actually should be converted by a factor of 2.1, but 2 would have been closer than 2.8 used based on the mm->pt conversion I used. What I need to figure out is that roughly 2x height to pt conversion in the Schriftgroessen file something that could be valid or just coincidence in the factors similar?
Perhaps a better method here is assume that 1 unit (based on the file, mm, inches etc) is equal to 1pt and then scale based on the 1mm = 2px, perhaps I should always assume 1mm = 1pt, and then scale. I'm not really sure, I'll need to do more testing to try and narrow down what the right scaling factor might be, and need to make sure I'm testing against multiple units.
I think the next step for me to do is create a handful of files along the lines of Schriftgroessen but in several units like inches, ft, cm, etc and do some testing to try and narrow down a more accurate scaling factor.
Hopefully that makes things a bit more clear.