Author Topic: Changing TTF Fonts  (Read 4578 times)

0 Members and 1 Guest are viewing this topic.

cmwade77

  • Swamp Rat
  • Posts: 1434
Changing TTF Fonts
« on: May 27, 2014, 02:58:17 PM »
We have some xRefs that are causing performance problems on our systems. Autodesk is telling me that it's because they use TTF fonts. I don't know if I actually believe that, but I would like to rule this out in the future.

So, before I reinvent the wheel, I thought I would check if anyone has a routine that replaces .TTF fonts with .SHX fonts. What I would think it would do first is see if there is one of the same name and if not, then default to a specific .SHX font.

ronjonp

  • Needs a day job
  • Posts: 7524
Re: Changing TTF Fonts
« Reply #1 on: May 27, 2014, 03:15:11 PM »
Untested, but this should work:
Code: [Select]
(defun c:foo (/ name)
  (vlax-for st (vla-get-textstyles (vla-get-activedocument (vlax-get-acad-object)))
    (if (setq name (findfile (strcat (vl-filename-base (vla-get-fontfile st)) ".shx")))
      (vl-catch-all-apply 'vla-put-fontfile (list st name))
      (vl-catch-all-apply 'vla-put-fontfile (list st "romans.shx"))
    )
  )
  (princ)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

cmwade77

  • Swamp Rat
  • Posts: 1434
Re: Changing TTF Fonts
« Reply #2 on: May 27, 2014, 04:28:37 PM »
Thank you, that seems to work quite nicely. I will be adding it to my background cleanup routine.

ronjonp

  • Needs a day job
  • Posts: 7524
Re: Changing TTF Fonts
« Reply #3 on: May 28, 2014, 09:21:52 AM »
Glad to help  8)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

mammajamma

  • Guest
Re: Changing TTF Fonts
« Reply #4 on: May 28, 2014, 11:43:21 AM »
We have some xRefs that are causing performance problems on our systems. Autodesk is telling me that it's because they use TTF fonts. I don't know if I actually believe that, but I would like to rule this out in the future.


Oh my gosh, I hope this isn't the case, since we were just convinced to change our standard font across all our CAD programs to a truetype because Revit doesn't like shx. Fortunately, we don't use text on xrefs (yeah, right, in a perfect world)...
I guess time will tell.

LE3

  • Guest
Re: Changing TTF Fonts
« Reply #5 on: May 28, 2014, 11:55:58 AM »
We have some xRefs that are causing performance problems on our systems. Autodesk is telling me that it's because they use TTF fonts. I don't know if I actually believe that, but I would like to rule this out in the future.


Oh my gosh, I hope this isn't the case, since we were just convinced to change our standard font across all our CAD programs to a truetype because Revit doesn't like shx. Fortunately, we don't use text on xrefs (yeah, right, in a perfect world)...
I guess time will tell.

Yes, we started to avoid the use of the true type fonts in all of our templates (and most all that came from solidworks models), about three years ago, we noticed that back then and our automate system performance have worked much nicer.... my 0.2 pesos worth....

cmwade77

  • Swamp Rat
  • Posts: 1434
Re: Changing TTF Fonts
« Reply #6 on: May 28, 2014, 12:37:43 PM »
We have some xRefs that are causing performance problems on our systems. Autodesk is telling me that it's because they use TTF fonts. I don't know if I actually believe that, but I would like to rule this out in the future.


Oh my gosh, I hope this isn't the case, since we were just convinced to change our standard font across all our CAD programs to a truetype because Revit doesn't like shx. Fortunately, we don't use text on xrefs (yeah, right, in a perfect world)...
I guess time will tell.

Yes, we started to avoid the use of the true type fonts in all of our templates (and most all that came from solidworks models), about three years ago, we noticed that back then and our automate system performance have worked much nicer.... my 0.2 pesos worth....
Unfortunately, our xrefs come from all sorts of other firms, which is why we have cleanup routines in place. This simply adds an additional cleanup item to the list of things it does.

cmwade77

  • Swamp Rat
  • Posts: 1434
Re: Changing TTF Fonts
« Reply #7 on: June 24, 2014, 06:25:08 PM »
Just a heads up, after going through and applying this to a project that has a lot of TTF fonts in the xrefs, I can confirm that using SHX fonts instead make a HUGE difference.

danallen

  • Guest
Re: Changing TTF Fonts
« Reply #8 on: June 24, 2014, 06:58:33 PM »
is the text in PDFs still searchable? My experience has been that only TTF fonts create searchable / selectable text in PDFs.

cmwade77

  • Swamp Rat
  • Posts: 1434
Re: Changing TTF Fonts
« Reply #9 on: June 24, 2014, 07:11:21 PM »
I just tested (we never do this in PDFs from CAD files) and it is not; however, if you use Bluebeam Extreme, you could use OCR to recognize the text first, then it would be searchable.

Additionally, depending on which PDF writer you are using, you can substitute SHX fonts with TTF fonts when there are exact matches available. The built in DWG to PDF writer appears to have some ability to do this by selecting the Capture All option under Font Handling in Custom Properties.

In our case the question becomes is it more important to be able to open the file in under 45 minutes (yes we had a file that was taking that long because of TTF fonts being used in the xRefs) or is it more important to be able to search the PDFs? Our vote was for faster opening in this case (down from 45 Minutes to approximately 45 seconds)

danallen

  • Guest
Re: Changing TTF Fonts
« Reply #10 on: June 24, 2014, 07:22:50 PM »
Weird that you have such problems with TTF, we only use them and never have had that problem, even with full sheets of notes. Are you using text styles with widths different than 1.0? I have seen issues previously in the PDFs render such scaled text as vectors, not text.

cmwade77

  • Swamp Rat
  • Posts: 1434
Re: Changing TTF Fonts
« Reply #11 on: June 24, 2014, 07:24:47 PM »
Weird that you have such problems with TTF, we only use them and never have had that problem, even with full sheets of notes. Are you using text styles with widths different than 1.0? I have seen issues previously in the PDFs render such scaled text as vectors, not text.
These are various items in files that others send us, not in our own files. These files are then xrefed into our plans. The files were fine when opened directly, but once they are xrefed into other plans, it causes the slow down. Autodesk even has an article on it, so they know it happens as well.

We never have a problem if we create the files in the first place either, but they obviously are doing something to the fonts that causes the problem.