need lisp code to remap the fonts
hello lisp experts,
i need a small piece of code to remap the fonts inside the dwg file to the one attached i.e. default.fmp, so that dwg file can be converted to searchable pdf.
thanks in advance.
0
Comments
-
This can be achieved without Lisp code. All you have to do is (temporarily) change the BricsCAD font folder in the SRCHPATH to a non-existent folder and then restart BricsCAD.
To change the SRCHPATH:
_SETTINGS command > Program options > Files > Support file search path > click the '...' button > Change 'Fonts' to 'FontsNoFolder'.
After the restart BricsCAD will use the settings from default.fmp and the alternate font (FONTALT) for unmapped fonts.0 -
Alternative is to place the default.fmp in the same folder as the drawing. BricsCAD looks in the folder of the open drawing prior to looking along the search path. settings in default.fmp takes precedence over FONTALT. Another option is to set FONTMAP to point to a different .fmp file. As Roy has noted these changes require a restart of BricsCAD.
The searchable text feature of _EXPORT seems to be quite a compelling feature, working with .shx & .ttf font files. Also doesn't seem to be affected by other drawing options, or commands, such as writing the text backwards, width factor, xref clipping etc. Attach a sample drawing to illustrate.
There are a few things I've come across that you may need to be aware of:- Print related FIELDs don't update on export.
- V13 export to PDF produces a smaller file than V12 (believe V12 renders text as an image), however it seems to have issues with solid fills. You can see this if you look at the logo on the attached PDFs.
Regards,Jason Bourhill
CCL-SearchableText2-V13.pdfCCL-SearchableText2.zipCCL-SearchableText2-V12.pdf
0 -
After reading Jason's post, and testing some more, I conclude that changing the BricsCAD fonts folder is only required if you want to use FONTALT for unresolved fonts.
BricsCAD uses this order:
1. Use mapping from FONTMAP (default.fmp).
2. Resolve all fonts using the SRCHPATH and system fonts.
3. Use FONTALT for all unresolved fonts.
@ Jason:
You say 'The searchable text feature of _EXPORT seems to be quite a compelling feature, working with .shx & .ttf font files.' But I cannot create a such a PDF file with SHX and the _EXPORT function. Nor can the OP. On your PDF I find this text: 'PRINTER: PDFCREATOR'. So how did you create this searchable SHX PDF? Note: I have the 'Convert SHX text to geometry' setting turned off.0 -
Sorry Roy, you are quite correct. EXPORT only generates searchable text for TTF type fonts, not .SHX. I created this drawing quite a while ago, and had forgotten the critical details. I also raised a support request at the time (SR37240) in regards to all this, as I see generating searchable PDFs as quite desirable, and the majority of existing drawings would still be using SHX style fonts.
To make the PDF searchable I used a workaround:- I first installed DWG TrueView, as part of the install process TrueView installs .SHX & .TTF versions of the common AutoCAD fonts.
- I then updated my default.fmp file to substitute the SHX font with its TTF variant. You will see this if you open the default.fmp from my previous post.
EXPORT has a number of restrictions that makes it less appealing to use than printing.- Doesn't provide a familiar print dialogue. Instead you have to apply a print set up to a layout first, This also has issues currently with BricsCAD (see SR36190).
- Doesn't export using Visual Styles.
- Doesn't seem to export solid hatch that well (see how my logo is rendered).
- Can't use with Publish to batchplot multiple drawings.
- Doesn't update fields prior to generation.
- Doesn't update plot related fields such as PlotDate, DeviceName etc. which is why use see the reference to PDFCreator in my export, and a plot date of 2012-11-09 even though I created Today.
Note. if you are generating .fmp files. BricsCAD accepts comment lines in the .fmp, AutoCAD doesn't, so keep that in mind if you plan to share.
I believe a lot of people stick with .shx it's what they have always have used, and because of speed. TTF defined styles don't behave well when you change them from their defaults such as applying a width factor, oblique angle, use them in a block with unequal scaling etc. In these cases the CAD application resorts to displaying the text as a bitmap, which leads to a performance drop. This website goes into this in more detail
http://www.cadinfo.net/s13-how-to-use-cad-programs/c83-how-to-use-autocad/truetype-in-autocad-font-problems-revisited/
You can see from this, and from other sites, that generating searchable PDFs is even more problematic in AutoCAD, which is why the EXPORT option in BricsCAD is so appealing. It is almost, but not quite a solution.
Apologise again for any confusion I caused with my previous post.
Regards,Jason Bourhill
0 -
Jason, thanks you for the clarification and the links.0
-
thanks for the help. i am using the following option. it is working.
"Alternative is to place the default.fmp in the same folder as the drawing."
0
This discussion has been closed.