![]() |
#1
|
||||
|
||||
![]()
I want to write a macro for creating numbers for jerseys. the question is, if I create a drop down of the fonts that I want to make available, (not actual installed fonts), and the font the user chooses is not installed, is there a way to install it on the fly? It has been suggested that I check my list against installed fonts and truncate the list to only available installed fonts., but I want to have the same fonts available every time the macro runs.
__________________
Sean Waiting for a ride in the T.A.R.D.I.S. |
#2
|
||||
|
||||
![]()
You can use the Windows API to install the fonts....
Code:
Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Long Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long Private Sub cmb_Load_Click() AddFontResource "C:\Temp\Berling.ttf" End Sub Private Sub cmb_Unload_Click() RemoveFontResource "C:\Temp\Berling.ttf" End Sub -Shelby |
#3
|
|||
|
|||
![]()
If you use Bistream Font Navigator (that comes with Corel) to add fonts you won't need to restart coreldraw. Also once you perform the "find fonts" in Font Navigator it just finds fonts but does not install it all at a time, but when you try to open a file with some missing fonts it will install the missing fonts of its own and open the file. Generally what I do is, I make a folder somewhere on the disk that contains all the thousands of fonts, and Font Navigator installs it whenever needed.
Hope it helps |
#4
|
||||
|
||||
![]()
Vindaa, thank you for your reply, but I am well aware of Font Navigator and it's capabilities (and lack thereof). What I am looking for is what Shelby posted about using the API to install a font via VBA code during the running of a macro. Unless I can find a way to refresh the application, (haven't looked to see if there is an Application.Refresh for Draw) then my idea won't work.
__________________
Sean Waiting for a ride in the T.A.R.D.I.S. |
#5
|
|||
|
|||
![]() Quote:
.ForceUpdateFontTable You should also use this API, so other apps that actually listen for the message will know you installed a new font... Code:
Private Const HWND_BROADCAST As Long = &HFFFF& Private Const WM_FONTCHANGE As Long = &H1D Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Sub MySub() 'Font Install/Uninstall Stuff .ForceUpdateFontTable Call SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, ByVal 0&) End Sub |
#6
|
||||
|
||||
![]()
Thanks Steve Dude. Pre-shade-it
__________________
Sean Waiting for a ride in the T.A.R.D.I.S. |
#7
|
|||
|
|||
![]()
Not a problem...It working fine for me in one my dockers.
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Install Spot Colors from C++ | dynamica | CorelDRAW/Corel DESIGNER VBA | 1 | 02-03-2007 09:14 |
Install Spot Colors form C++ | dynamica | CorelDRAW CS | 0 | 01-03-2007 03:45 |
Cannot Install Calendar Wizard 4.1 | markr | Calendar Wizard | 1 | 18-05-2006 08:41 |
Re-install question | IMRKE | General | 2 | 25-02-2006 20:10 |
Doing a clean install with CDGS12 up grade? | Ghidrah | General | 0 | 26-11-2004 13:49 |