Hi all,
I have two service applications that talk to each other via TCP. (one sends raw data to the other, which opens an Excel template that uses the raw data to populate itself and print).
I want to add font support to this arrangement so that the sending service has a list of required fonts in a table that it can use to interrogate the receiver service to find out if it's missing any of them. If it's missing some, it will send the .TTF file(s) across the TCP session and the receiver service will install them.
The problems:
1. Truetype fonts appear to have a Name, a Typeface Name, and a Filename - all different.
For example, Name=Futura Extra Black Italic BT (TrueType),
TypeFace=Futura XBlkIt BT,
Filename=TT0149M_.TTF.
To be manageable, I need the list that the sending service uses to have the TypeFace names, as these are what appears in Excel. How can I get the Filename from the Typeface name? The registry key HKLM\Software\Microsoft\Windows NT\Current Version\Fonts only lists the Name and Filename relationship.
2. How can the receiver service decide whether or not it has the required fonts installed? Being a service, it doesn't have access to the Screen.Fonts object.
It would seem that both these answers could be solved by extracting the Typeface Name from the actual font file (unless this relationship exists somewhere else). I've found a TrueType specification document - it's quite convoluted. Does anyone have any working code in their libraries that I can use? Or an alternative method to accomplish what I want?
Many thanks.
I have two service applications that talk to each other via TCP. (one sends raw data to the other, which opens an Excel template that uses the raw data to populate itself and print).
I want to add font support to this arrangement so that the sending service has a list of required fonts in a table that it can use to interrogate the receiver service to find out if it's missing any of them. If it's missing some, it will send the .TTF file(s) across the TCP session and the receiver service will install them.
The problems:
1. Truetype fonts appear to have a Name, a Typeface Name, and a Filename - all different.
For example, Name=Futura Extra Black Italic BT (TrueType),
TypeFace=Futura XBlkIt BT,
Filename=TT0149M_.TTF.
To be manageable, I need the list that the sending service uses to have the TypeFace names, as these are what appears in Excel. How can I get the Filename from the Typeface name? The registry key HKLM\Software\Microsoft\Windows NT\Current Version\Fonts only lists the Name and Filename relationship.
2. How can the receiver service decide whether or not it has the required fonts installed? Being a service, it doesn't have access to the Screen.Fonts object.
It would seem that both these answers could be solved by extracting the Typeface Name from the actual font file (unless this relationship exists somewhere else). I've found a TrueType specification document - it's quite convoluted. Does anyone have any working code in their libraries that I can use? Or an alternative method to accomplish what I want?
Many thanks.