private font collection - delete

  • Thread starter Thread starter al jones
  • Start date Start date
A

al jones

Okay, last go 'round for today. I'm looking at the msdn for private font
collections. If I add a font to work with - let's presume I'm printing a
single line in a particular font and won't use it again - how do I dispose
of it.

For the sake of arguement, let's assume I'm printing (to the rtb) a sample
of several (hubdred?) fonts on my system -- once I've printed the sample
text, I no longer have need of that particular font, but see no way to
reverse the .addfontfile. Memory may be cheap - but it would seem
practical to be able to dispose of the font once done ...

Am I missing the obvious here?? //al
 
Hello al,

You must dispose the PrivateFontCollection, you can't remove individual fonts.
I did a program to print samples of fonts and my solution was to create a new PrivateFontCollection for each page and dispose it after printing the page, as those fonts wouldn't be used in the next page.

Regards.


"al jones" <[email protected]> escribió en el mensaje | Okay, last go 'round for today. I'm looking at the msdn for private font
| collections. If I add a font to work with - let's presume I'm printing a
| single line in a particular font and won't use it again - how do I dispose
| of it.
|
| For the sake of arguement, let's assume I'm printing (to the rtb) a sample
| of several (hubdred?) fonts on my system -- once I've printed the sample
| text, I no longer have need of that particular font, but see no way to
| reverse the .addfontfile. Memory may be cheap - but it would seem
| practical to be able to dispose of the font once done ...
|
| Am I missing the obvious here?? //al
 
Hi,

I'm surorised you haven't come across the "Memory corruption or an access
violation may occur in a custom application that uses the
PrivateFontCollection object in Windows XP" problem documented in KB 901026
when you are disposing of a lot of PrivateFontCollections.
 
Hello Nigel,

In fact, I did. My workaround for that problem was tu use a single PrivateFontCollection for each font, then dispose the font family before disposing the PrivateFontCollection:

pfc = new privatefontcollection
pfc.addfontfile("...")
ff = pfc.families(0)
'Print the font sample
ff.dispose
pfc.dispose


Regards.


"Nigel Borrill" <[email protected]> escribió en el mensaje | Hi,
|
| I'm surorised you haven't come across the "Memory corruption or an access
| violation may occur in a custom application that uses the
| PrivateFontCollection object in Windows XP" problem documented in KB 901026
| when you are disposing of a lot of PrivateFontCollections.
|
| "José Manuel Agüero" wrote:
|
| > Hello al,
| >
| > You must dispose the PrivateFontCollection, you can't remove individual fonts.
| > I did a program to print samples of fonts and my solution was to create a new PrivateFontCollection for each page and dispose it after printing the page, as those fonts wouldn't be used in the next page.
| >
| > Regards.
| >
| >
| > "al jones" <[email protected]> escribió en el mensaje | > | Okay, last go 'round for today. I'm looking at the msdn for private font
| > | collections. If I add a font to work with - let's presume I'm printing a
| > | single line in a particular font and won't use it again - how do I dispose
| > | of it.
| > |
| > | For the sake of arguement, let's assume I'm printing (to the rtb) a sample
| > | of several (hubdred?) fonts on my system -- once I've printed the sample
| > | text, I no longer have need of that particular font, but see no way to
| > | reverse the .addfontfile. Memory may be cheap - but it would seem
| > | practical to be able to dispose of the font once done ...
| > |
| > | Am I missing the obvious here?? //al
| >
 
Back
Top