Hi - I'm a happy QCAD Pro user, but I have another lower-level project that could really use some simple vector fonts. Is there any documentation for the CXF format?
Thanks,
Stewart
CXF file format description?
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Re: CXF file format description?
The format of the glyphs in .cxf files is:
Example for 'C' in fort standard:
Capital letters are typically defined between Y=0 and Y=9 with the left border at X=0.
In the header, the letter spacing, word spacing, line spacing and scale (if height!=9) can be defined.
Perhaps you could briefly indicate what you are doing and why you need line fonts vs. TrueType fonts and why the available fonts are not sufficient. Perhaps there is a better solution than creating a new font.
Code: Select all
[<hex unicode>] <character (optional for better readability)>
<'L' for line> <start x>,<start y>,<end x>,<end y>
<'A for arc (CCW)'> <center x>,<center y>,<radius>,<start angle in degrees>,<end angle in degrees>
<'AR for reversed arc (CW)'> <center x>,<center y>,<radius>,<start angle in degrees>,<end angle in degrees>
Code: Select all
[0043] C
L 4,9,2,9
A 2,7,2,90,180
L 0,7,0,2
A 2,2,2,180,270
L 2,0,4,0
In the header, the letter spacing, word spacing, line spacing and scale (if height!=9) can be defined.
Perhaps you could briefly indicate what you are doing and why you need line fonts vs. TrueType fonts and why the available fonts are not sufficient. Perhaps there is a better solution than creating a new font.
Re: CXF file format description?
Thanks, Andrew! Much appreciated.
Sure! I'm driving old HP-GL pen plotters from Python. I'm using the Shapely and Fiona libraries to handle 2D geometry and arbitrary vector file formats. HP-GL's text formatting is weak and old fashioned. If I'm able to use someone else's vector fonts, I'll be able to render complex characters as vectors and plot them on any device.andrew wrote:Perhaps you could briefly indicate what you are doing and why you need line fonts vs. TrueType fonts and why the available fonts are not sufficient. Perhaps there is a better solution than creating a new font.
Re: CXF file format description?
Ah, makes sense now I thought you were going to create your own CXF fonts.Sure! I'm driving old HP-GL pen plotters from Python. I'm using the Shapely and Fiona libraries to handle 2D geometry and arbitrary vector file formats. HP-GL's text formatting is weak and old fashioned. If I'm able to use someone else's vector fonts, I'll be able to render complex characters as vectors and plot them on any device.
I hope the QCAD fonts will be useful for your project!
Re: CXF file format description?
Well, about as much sense as wanting to run a large, slow, loud (but mesmerizing) pen plotter ever would!
I did see one other command used: AR, as in the & character in the Cursive font:
Is that any different from the regular Arc command, please?
I did see one other command used: AR, as in the & character in the Cursive font:
Code: Select all
[0026] &
L 4.9832,0,2.997,6.9891
AR 4.2844,7.3549,1.3384,195.865,307.833
L 5.1053,6.2979,1.2595,3.3113
A 2.3943,1.8501,1.8501,127.833,307.833
L 3.5291,0.3889,6.7596,2.8978
Re: CXF file format description?
Is there a way to create a filled shape with this, such as '●' ?
Re: CXF file format description?
No, CXF fonts are strictly lines and arcs by definition. TTF fonts on the other hands contain only filled surfaces.lgreng wrote:Is there a way to create a filled shape with this, such as '●' ?