See the top rated post in this thread. Click here

Results 1 to 8 of 8

Thread: Font Style Problem

  1. #1
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    418
    Login to Give a bone
    0

    Default Font Style Problem

    Hi AUGI Members,

    I have a lisp routine that creates a font style on the fly and then places the text string. However, on a few workstations the routine fails stating it cannot create that font style and I have no idea why this is happening because the "Arial.ttf" font style is installed on all workstations.

    Below is an example of the code that is failing on several workstations......and it would be greatly appreciated if anyone could identify the problem or recommend / suggest how to resolve this issue..!!

    Code:
    (Defun C:TX18 ()
      (SetVar "CMDECHO" 0)
      (Setq DTS (TBLSEARCH "STYLE" "TXT18"))
      (IF (= DTS NIL)(Progn
        (Command "-Style" "TXT18" "Arial.ttf" "8.7" "1" "0" "N" "N")
        (COMMAND "SETVAR" "TEXTSTYLE" "TXT18")
        ))
     
      (Command "Dtext")
      (Setq DTS NIL)
      (SetVar "CMDECHO" 1)
    )

    Thank you in advance for your assistance,
    CADdancer

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,180
    Login to Give a bone
    0

    Default Re: Font Style Problem

    Just a thought, you mention that the fonts are installed in all machines..
    Where are the fonts? Are they in Windows\fonts? or some other location?
    Do you have the proper support and trusted paths for all the machines?
    In other words, maybe AutoCAD can't find them because they are not in the support path list
    Ted
    ____________________________________________________________________ ________________
    Windows 7 Professional
    AutoCAD 2018 - REVIT 2019 - Inventor Professional 2017 (when I can)

  3. #3
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    418
    Login to Give a bone
    0

    Default Re: Font Style Problem

    Hi Ted,

    Thank you for your response..!! We have approximately 175 workstations running AutoCAD and only 3-5 are experiencing this problem, However, I did go on one of the stations where this is happening and incorporated the "C:\Windows\Fonts" path in the "Options-->Support File Search Path" and it did not resolve the difficulty..!!


    Any other thoughts..??


    Thank you,
    CADdancer

  4. #4
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,180
    Login to Give a bone
    0

    Default Re: Font Style Problem

    Quote Originally Posted by CADdancer View Post
    Hi Ted,

    Thank you for your response..!! We have approximately 175 workstations running AutoCAD and only 3-5 are experiencing this problem, However, I did go on one of the stations where this is happening and incorporated the "C:\Windows\Fonts" path in the "Options-->Support File Search Path" and it did not resolve the difficulty..!!


    Any other thoughts..??


    Thank you,
    CADdancer
    No new thoughts at this time.
    Quick question, did you restart AutoCAD on that station you added the support path?
    If you didn't you might want to try that first and then run the lisp.
    Ted
    ____________________________________________________________________ ________________
    Windows 7 Professional
    AutoCAD 2018 - REVIT 2019 - Inventor Professional 2017 (when I can)

  5. #5
    Certifiable AUGI Addict cadtag's Avatar
    Join Date
    2000-12
    Location
    Cairo - no, not Illinois
    Posts
    4,753
    Login to Give a bone
    1

    Default Re: Font Style Problem

    TrueType and OpenType (ttf & otf extensions) do not need to be in the support path for AutoCAD. As long as they are properly installed in Windows, they should work. Verify that they are available in other Windows applications (word, excel, powerpoint, and if they work there, then they ought to be available in Acad.

    If not, try removing them from the problem machines, and re-installing the ttf from a machine that works. possibly the files are corrupted just enough for Acad to fubar on them.
    Real pirates wear silk suits & ties, and write EULAs
    The only thing more dangerous to the liberty of a free people than big government, is big business.

    Toward a Sustainable Water Future: Visions for 2050 http://ascelibrary.org/doi/book/10.1061/9780784412077

  6. #6
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    3,236
    Login to Give a bone
    0

    Default Re: Font Style Problem

    [QUOTE=CADdancer;1343951]Hi AUGI Members,

    I have a lisp routine that creates a font style on the fly and then places the text string. However, on a few workstations the routine fails stating it cannot create that font style and I have no idea why this is happening because the "Arial.ttf" font style is installed on all workstations.

    Your code only sets TXT18 current if it's not found and setting TX18 as a global variable may conflict with a command or function on one of those workstations. This version doesn't use any global variables and always starts Dtext with TXT18 as the current style.
    Code:
    (Defun C:TX18 ()
     (setvar "CMDECHO" 0)
     (or
      (TBLSEARCH "STYLE" "TXT18")
      (command-s "-Style" "TXT18" "Arial.ttf" "8.7" "1" "0" "N" "N")
     )
     (setvar "TEXTSTYLE" "TXT18")
     (command "Dtext")
     (setvar "CMDECHO" 1)
    )
    Tom Beauford P.S.M. - Civil 2019 on Windows 10 Enterprise
    Design Analysis - Leon County Public Works/Engineering Wrap [CODE] tags around selected text
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516 Home Page

  7. #7
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    418
    Login to Give a bone
    0

    Default Re: Font Style Problem

    Thank you for your response Tom..!!

    This problem only exists on 2 - 3 workstations......on all other computers the code works fine. I would think if the code created a conflict it would occur on all workstations..??


    Thank you,
    CADdanced

  8. #8
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL
    Posts
    3,236
    Login to Give a bone
    0

    Default Re: Font Style Problem

    Quote Originally Posted by CADdancer View Post
    Thank you for your response Tom..!!

    This problem only exists on 2 - 3 workstations......on all other computers the code works fine. I would think if the code created a conflict it would occur on all workstations..??


    Thank you,
    CADdanced
    Assuming the Text Style was modified in the drawings open on those PC's removing the "if" in your code will either add or fix the TXT18 Text Style which should work properly on all workstations.
    Code:
    (Defun C:TX18 ()
      (SetVar "CMDECHO" 0)
      (Command "-Style" "TXT18" "Arial.ttf" "8.7" "1" "0" "N" "N")
      (COMMAND "SETVAR" "TEXTSTYLE" "TXT18")
      (Command "Dtext")
      (SetVar "CMDECHO" 1)
    )
    Tom Beauford P.S.M. - Civil 2019 on Windows 10 Enterprise
    Design Analysis - Leon County Public Works/Engineering Wrap [CODE] tags around selected text
    2280 Miccosukee Rd. Tallahassee, FL 32308-5310
    Ph# (850)606-1516 Home Page

Similar Threads

  1. Canging TTF font in Text Style via lisp yields incorerect font.
    By jpcadconsulting347236 in forum AutoLISP
    Replies: 2
    Last Post: 2019-02-28, 06:31 PM
  2. Replies: 1
    Last Post: 2018-01-31, 02:45 PM
  3. Converting SHX Font to True Type Font
    By dortega4269 in forum Revit Structure - General
    Replies: 1
    Last Post: 2006-09-01, 05:19 PM
  4. Swap old custom font file for new font file
    By dgalloway in forum AutoCAD Customization
    Replies: 2
    Last Post: 2006-02-02, 03:09 PM
  5. Replies: 5
    Last Post: 2005-01-04, 07:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •