Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualjwezorek

Posted 29 January 2013 - 09:20 PM

I'm just having trouble with the "somehow mapping that font back to a font file" part.

 

Well, that code project code is doing the following ( I think)

 

(1) Uses the registry to get a list of registry key -> font filename mappings, where the registry keys are like marked-up display names.

(2) Given a font display name, returns the filename associated with the first registry key that includes the display name as a substring.

 

You could use (1) because it is presumably faster than iterating over the file system, but do something more intelligent for (2). Namely you could write a function that given a font display name returns the set of all likely registry keys and open just those font files to find the one you want. But I  don't know exactly what is in the registry; maybe what the code project project is doing is good enough.


#7jwezorek

Posted 29 January 2013 - 09:20 PM

I'm just having trouble with the "somehow mapping that font back to a font file" part.

 

Well, what that code project code is doing the following ( I think)

 

(1) Uses the registry to get a list of registry key -> font filename mappings, where the registry keys are like marked-up display names.

(2) Given a font display name, returns the filename associated with the first registry key that includes the display name as a substring.

 

You could use (1) because it is presumably faster than iterating over the file system, but do something more intelligent for (2). Namely you could write a function that given a font display name returns the set of all likely registry keys and open just those font files to find the one you want. But I  don't know exactly what is in the registry; maybe what the code project project is doing is good enough.


#6jwezorek

Posted 29 January 2013 - 09:19 PM

I'm just having trouble with the "somehow mapping that font back to a font file" part.

 

Well, what that code project code is doing the following ( I think)

 

(1) Uses the registry to get a list of registry key -> font filename mappings, where the registry keys are like marked-up display names.

(2) Given a font display name, returns the filename associated with the first registry key that includes the display name as a substring.

 

You could use (1) because it is presumably faster than iterating over the file system, but do something more intelligent for (2). Namely you could write a function that given a font display name returns the set of all likely registry keys and open just those font files to find the one you want. But I  don't know exactly what is in the registry.


#5jwezorek

Posted 29 January 2013 - 09:18 PM

I'm just having trouble with the "somehow mapping that font back to a font file" part.

 

Well, what that code project code is doing the following ( I think)

 

(1) Uses the registry to get a list of registry key -> font filename mappings, where the registry keys are like marked-up display names.

(2) Given a font display name, returning the first font filename registry key that includes the display name as a substring.

 

You could use (1) because it is presumably faster than iterating over the file system, but do something more intelligent for (2). Namely you could write a function that given a font display name returns the set of all likely registry keys and open just those font files to find the one you want. But I  don't know exactly what is in the registry.


#4jwezorek

Posted 29 January 2013 - 09:18 PM

I'm just having trouble with the "somehow mapping that font back to a font file" part.

 

Well, what that code project code is doing the following ( I think)

 

(1) Uses the registry to get a list of registry key -> font filename mappings, where the registry keys are liked marked-up display names.

(2) Given a font display name, returning the first font filename registry key that includes the display name as a substring.

 

You could use (1) because it is presumably faster than iterating over the file system, but do something more intelligent for (2). Namely you could write a function that given a font display name returns the set of all likely registry keys and open just those font files to find the one you want. But I  don't know exactly what is in the registry.


#3jwezorek

Posted 29 January 2013 - 09:18 PM

I'm just having trouble with the "somehow mapping that font back to a font file" part.

 

Well, what that code project code is doing the following ( I think)

 

(1) Uses the registry to get a list of registry key -> font filenames, where the registry keys are liked marked-up display names.

(2) Given a font display name, returning the first font filename registry key that includes the display name as a substring.

 

You could use (1) because it is presumably faster than iterating over the file system, but do something more intelligent for (2). Namely you could write a function that given a font display name returns the set of all likely registry keys and open just those font files to find the one you want. But I  don't know exactly what is in the registry.


PARTNERS