Open airsxue opened 2 years ago
Hello, Thanks for your hard work for netDxf,I just want to know how can I get the total Length of a text or Mtext(as below pic. )? Thanks!
BTW, I used tried to get the total Length by the "total Char count"* "width factor", but the result sstill has deviation with actual length.
Hello, Thanks for your hard work for netDxf,I just want to know how can I get the total Length of a text or Mtext(as below pic. )? Thanks!
sorry, correct the method i used tried, it should be "total Char count" "width factor" textHeight
As far as I know, the length of the text is depends on the system's graphic render. So there's no method to get the text length before render. In windows, you can do this by gdi or gidplus. see https://stackoverflow.com/questions/263614/calculate-the-display-width-of-a-string-in-c
As far as I know, the length of the text is depends on the system's graphic render. So there's no method to get the text length before render. In windows, you can do this by gdi or gidplus. see https://stackoverflow.com/questions/263614/calculate-the-display-width-of-a-string-in-c
Got it with many thanks
Both SHX and TTF fonts stores vector data information from which you can, from every single character (glyph), build words, sentences, paragraphs,... and get its measurements; but you will need to use other libraries for that. So, it is not true that the length of the text depends on the system graphic render, although it is common in them to find some kind getLength method.
Both SHX and TTF fonts stores vector data information from which you can, from every single character (glyph), build words, sentences, paragraphs,... and get its measurements; but you will need to use other libraries for that. So, it is not true that the length of the text depends on the system graphic render, although it is common in them to find some kind getLength method.
so may i have your suggestion on which libraires can i use to measure the length of text? thanks
Hello, Thanks for your hard work for netDxf,I just want to know how can I get the total Length of a text or Mtext(as below pic. )? Thanks!![image](https://user-images.githubusercontent.com/44011133/184534628-6a11f01c-44a7-495b-acdb-069999984bc0.png)