cart: empty [ Login ]

regular text to vector text

1 
Youssef ABDMOUELH
2/15/2024 3:14 PM
Hi, This is my first try of CadLib 4.0 and I want to import some vector text with specfied font to my application, but the font doesn't apply and i don't know how to vectorize the text. Thanks in advance.
cadlib4.0.png
Wout
2/15/2024 3:18 PM
Hi, Please post your input data and test code. - Wout
Youssef ABDMOUELH
2/15/2024 3:36 PM
Hello, this is the code ,it is based of the exemple: "DxfWriteExampleCS" exactly the "R12"code from trial version. // Extruded text in Custom font MS Reference Sans Serif DxfTextStyle textStyle1 = new DxfTextStyle("MYSTYLE1", "MS Reference Sans Serif.ttf"); model.TextStyles.Add(textStyle1); DxfText text1 = new DxfText("Extruded text in Custom font MS Reference Sans Serif", new Point3D(0d, 12d, 0d), 1d); text1.Thickness=0.2d; text1.Visible = true; text1.Style = textStyle1; model.Entities.Add(text1); // Extruded text in Custom font Rochester DxfTextStyle textStyle2 = new DxfTextStyle("MYSTYLE2", "rochester.ttf"); model.TextStyles.Add(textStyle2); DxfText text2 = new DxfText("Extruded text in Custom font Rochester", new Point3D(0d, 10d, 0d), 1d); text2.Thickness = 1d; text2.Visible = true; text2.Style = textStyle2; model.Entities.Add(text2);
Wout
2/16/2024 11:32 AM
Please post the complete code, the code you posted does not create the bitmap you posted. I have to be able to reproduce the problem you are reporting. - Wout
Youssef ABDMOUELH
2/16/2024 1:19 PM
Hi, the bitmap i posted is screenshot for the result from AI(i use the AI to see the result). This is the complet code :
C# Code:
#region (C) Wout Ware 2005-2006 // // File: DxfWriteExample.cs // // (c) 2005-2006 Wout Ware All Rights Reserved. // #endregion using System; using System.Drawing; using WW.Cad.Base; using WW.Cad.IO; using WW.Cad.Model; using WW.Cad.Model.Entities; using WW.Cad.Model.Tables; using WW.Math; namespace DxfWriteExample { class DxfWriteExample { /// <summary> /// Example of how to create a line, circle, arc, dimension, text (DXF release 12). /// </summary> private static void WriteExampleR12() { DxfModel model = new DxfModel(DxfVersion.Dxf12); // Extruded text in Custom font MS Reference Sans Serif DxfTextStyle textStyle1 = new DxfTextStyle("MYSTYLE1", "MS Reference Sans Serif.ttf"); model.TextStyles.Add(textStyle1); DxfText text1 = new DxfText("Extruded text in Custom font MS Reference Sans Serif", new Point3D(0d, 12d, 0d), 1d); text1.Thickness=0.2d; text1.Visible = true; text1.Style = textStyle1; model.Entities.Add(text1); // Extruded text in Custom font Rochester DxfTextStyle textStyle2 = new DxfTextStyle("MYSTYLE2", "rochester.ttf"); model.TextStyles.Add(textStyle2); DxfText text2 = new DxfText("Extruded text in Custom font Rochester", new Point3D(0d, 10d, 0d), 1d); text2.Thickness = 1d; text2.Visible = true; text2.Style = textStyle2; model.Entities.Add(text2); model.ZoomExtents(); DxfWriter.Write("DxfWriteExample-R12-ascii.dxf", model, false); } public static void Main(string[] args) { try { WriteExampleR12(); } catch (Exception e) { Console.Error.WriteLine("Error occurred: " + e.Message); Environment.Exit(1); } } } }
just to inform, i create "dxf" file has text as content, when i open the file in cnc application i find that text should be a vector text
Wout
2/16/2024 3:28 PM
Hi, I don't provide support to the AI software, so please don't post anything from AI on this forum. The true type font file names must exist, and if they do not, then CadLib will substitute Arial. On my machine there are no fonts with the file names you provided. The GetCoordinates example projects shows how to convert a drawing to polylines. - Wout
Youssef ABDMOUELH
2/16/2024 3:40 PM
Hi, sorry if i do mistakes thanks for support
1