Background
I have been developing a web app for my client. They are using LightBurn for Text Printing. This web app gives users an interface where they can enter text and app calculate the width/height (cm) of the text and price based on the dimensions. Users place order and then my client print their text using lightburn.
Problem
Now lightburn takes text, font file and then calculate width/height for the text. Such as height for one font could be different from other font for same text. In web app i’m calculating these dimensions using python native library ‘Pillow’. This library gives same dimensions with minor difference but with special characters this difference is huge.
Question
Does lightburn provides any kind of API for calculating dimensions or is there any third-party library which calculates same dimensions with same parameters?
I could use any tool (python, nodejs etc) for my solution.
I am going to answer your question in an indirect way.
Lightburn creates fonts in the workspace based on mm height. If I have a height of 25mm selected, Kunstler will come in at about 23mm. Viner will come in at about 28mm. However, I can resize both Kunstler Script and Viner Bold Hand ITC to be the same height. The person using Lightburn has final control of the font size.
If your library gives fixed heights for various fonts, it is doing what I did in Lightburn. If you are sending as TT Fonts, they are going to resize. You will need to send them as DXF, SVG, or possibly PDF to fixate the height.
LightBurn does not have API access at this time, though it on the roadmap.