Author Topic: How to find out where Acad reads font files from?  (Read 12538 times)

0 Members and 1 Guest are viewing this topic.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: How to find out where Acad reads font files from?
« Reply #15 on: July 23, 2007, 04:46:52 PM »
Correct ... if you browse to the Windows\Font folder and set the attributes of desktop.ini to -h -r -s, you will be able to copy it to another location and view the class id of the shell handler. You could then cross reference that in the registry to see what libraries are actually being used to give the folder the functionality you see.

Usually you can set your own context handlers for special folders, but the problem with the fonts folder is that windows allows only 1 to be active at any given time, therefore unless you change the default folder (and cause instability in Windows) you will not be able to create a second font folder, not that you would want to ...

Many folders have context handlers and you can actually create your own special folders if you create the context handler properly.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CaddmannQ

  • Guest
Re: How to find out where Acad reads font files from?
« Reply #16 on: July 23, 2007, 05:06:41 PM »
... if you browse to the Windows\Font folder and set the attributes of desktop.ini to -h -r -s, you will be able to copy it to another location and view the class id of the shell handler. You could then cross reference that in the registry to see what libraries are actually being used to give the folder the functionality you see....

Errrr... I think I'd rather poke myself with a sharp stick, but thanks anyway.  :wink:


Maverick®

  • Seagull
  • Posts: 14778
Re: How to find out where Acad reads font files from?
« Reply #17 on: July 23, 2007, 05:10:42 PM »
I think I'd rather poke myself with a sharp stick, but thanks anyway.  :wink:

*adjusts scorecard, polishes up the "exit only" sign*

CaddmannQ

  • Guest
Re: How to find out where Acad reads font files from?
« Reply #18 on: July 23, 2007, 05:22:02 PM »
I think I'd rather poke myself with a sharp stick, but thanks anyway.  :wink:

*adjusts scorecard, polishes up the "exit only" sign*

OK, call me dense, but I don't get the implications of that at all.  :|

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to find out where Acad reads font files from?
« Reply #19 on: July 23, 2007, 05:28:25 PM »
Kinda back on topic (no flame) ... Tim: If you want the actual font names just iterate the registry and create a reverse index of the keys / data:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

The key is the font name, the data is the font file.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How to find out where Acad reads font files from?
« Reply #20 on: July 23, 2007, 05:47:08 PM »
Thanks Michael.  Not sure yet if I want to go this route, but it's nice to have the option and knowledge.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: How to find out where Acad reads font files from?
« Reply #21 on: July 23, 2007, 07:26:15 PM »
Try this:
Code: [Select]
;;  Get the Windows Installed Fonts & the font file name
(defun get-fontList (/ dev reg)
  (if (or
        (setq dev "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Fonts"
              reg (vl-registry-descendents dev "*")
        )
        (setq dev "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"
              reg (vl-registry-descendents dev "*")
        )
      )
    (mapcar '(lambda(x) (list x (vl-registry-read dev x))) reg)
    )
)

;|  Returns a list
(("Caesar Regular (TrueType)" "C:\\WINDOWS\\Fonts\\caesar.TTF")
  ("Metro Regular (TrueType)" "C:\\WINDOWS\\Fonts\\metro.TTF")
  ("Zurich Extended BT (TrueType)" "C:\\WINDOWS\\Fonts\\ZURCHE.TTF")
  ("Arcitectura (TrueType)" "archtura.ttf")
  ("AMGDT (TrueType)" "AMGDT___.TTF")
  ("AmdtSymbols (TrueType)" "AMDT_Symbols.ttf")
  ("AIGDT (TrueType)" "AIGDT___.TTF")
  ("AcadEref (TrueType)" "AcadEref.ttf")
  ("ISOCTEUR Italic (TrueType)" "isocteui.ttf")
  ("ISOCTEUR (TrueType)" "isocteur.ttf")
  ("ISOCPEUR Italic (TrueType)" "isocpeui.ttf")
  ("ISOCPEUR (TrueType)" "isocpeur.ttf")
  ("Proxy 9 (TrueType)" "mtproxy9.ttf")
  ("Proxy 8 (TrueType)" "mtproxy8.ttf")
  ("Proxy 7 (TrueType)" "mtproxy7.ttf")
  ("Proxy 6 (TrueType)" "mtproxy6.ttf")
  ("Proxy 5 (TrueType)" "mtproxy5.ttf")
  ("Proxy 4 (TrueType)" "mtproxy4.ttf")
  )
  |:
 
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How to find out where Acad reads font files from?
« Reply #22 on: July 23, 2007, 07:35:41 PM »
The problem with going this way Alan is, when you try and set the FontFile property of the newly created style, you have to have the full path of the font.  Notice in some of the fonts listed they don't have the full path.  And you can't use 'findfile' on them.

I guess if they don't have a path, then you can see if they are located within the folder returned by Michael's code.  It's an idea I'm willing to play with, but I don't have time to test today, but should have some tomorrow.

Thanks Alan.  :-)

Quick example.
Quote from: Alan's code returned item ("Browallia New (TrueType)" "BROWA.TTF")
Command: (findfile "browa.ttf")
nil

Command: (findfile (strcat (_GetSpecialFolder "Fonts") "\\" "Browa.ttf"))
"C:\\WINDOWS\\Fonts\\Browa.ttf"
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: How to find out where Acad reads font files from?
« Reply #23 on: July 23, 2007, 07:54:06 PM »
Exactly!
And a modified version of MP's code: (please forgive the hack)
Code: [Select]
(defun _GetSpecialFolders ( / wshShell specialFolders result )
    (vl-catch-all-apply
       '(lambda ( )
            (setq
                wshShell       (vlax-create-object "WScript.Shell")
                specialFolders (vlax-get wshShell 'SpecialFolders)
            )
            (setq result (vlax-invoke specialFolders 'Item "Fonts"))
        )
    )
    (if specialFolders (vlax-release-object specialFolders))
    (if wshShell (vlax-release-object wshShell))
    result
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to find out where Acad reads font files from?
« Reply #24 on: July 23, 2007, 09:10:23 PM »
Code: [Select]
(defun _GetFontIndex ( / folder header footer result )

    (setq
        folder (_GetSpecialFolder "Fonts")
        header "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
        footer "\\CurrentVersion\\Fonts"
    )

    (vl-some
       '(lambda ( windows / key names paths )
            (and
                (setq
                    key   (strcat header windows footer)
                    names (vl-registry-descendents key "*")
                )
                (setq paths
                    (mapcar
                       '(lambda ( name / path )
                            (if
                                (eq ""
                                    (vl-filename-directory
                                        (setq path
                                            (vl-registry-read key name)
                                        )
                                    )
                                )
                                (strcat folder "\\" path)
                                path
                            )                           
                        )
                        names
                    )
                )
                (setq result
                    (mapcar 'cons
                        names
                        paths
                    )
                )
            )
        )
       '( "Windows NT" "Windows" )
    )
   
    (vl-sort
        result
       '(lambda ( a b ) (< (car a) (car b)))
    )
   
)

("AIGDT (TrueType)" . "C:\\Windows\\Fonts\\AIGDT___.TTF")
("AMGDT (TrueType)" . "C:\\Windows\\Fonts\\AMGDT___.TTF")
("AcadEref (TrueType)" . "C:\\Windows\\Fonts\\AcadEref.ttf")
...
("MT Extra (TrueType)" . "C:\\Program Files\\Common Files\\Microsoft Shared\\EQUATION\\MTEXTRA.TTF")
...
("Wingdings (TrueType)" . "C:\\Windows\\Fonts\\wingding.ttf")
("Wingdings 2 (TrueType)" . "C:\\Windows\\Fonts\\WINGDNG2.TTF")
("Wingdings 3 (TrueType)" . "C:\\Windows\\Fonts\\WINGDNG3.TTF")

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CaddmannQ

  • Guest
Re: How to find out where Acad reads font files from?
« Reply #25 on: July 23, 2007, 09:21:28 PM »
I think I'd rather poke myself with a sharp stick, but thanks anyway.  :wink:

*adjusts scorecard, polishes up the "exit only" sign*

OK, call me dense, but I don't get the implications of that at all.  :|

...and evidently nobody's going to bother to explain it either.

*sigh*

Maverick®

  • Seagull
  • Posts: 14778
Re: How to find out where Acad reads font files from?
« Reply #26 on: July 23, 2007, 09:44:42 PM »
 Believe me.  It's better that way.  :-D

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to find out where Acad reads font files from?
« Reply #27 on: July 23, 2007, 10:11:05 PM »
...and evidently nobody's going to bother to explain it either.

*sigh*

Dude it's all spelled out pretty clear here.

:)

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CaddmannQ

  • Guest
Re: How to find out where Acad reads font files from?
« Reply #28 on: July 23, 2007, 11:56:27 PM »
Oh, great! Next you'll be telling me the significance of the Time Kube and the Spork.  :roll:

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: How to find out where Acad reads font files from?
« Reply #29 on: July 24, 2007, 08:28:30 AM »
... the Spork. ...

Any self respecting geek will maintain posession of a titanium spork
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie