Home All Groups Group Topic Archive Search About

private font collection - delete

Author
10 Apr 2006 3:36 AM
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

Author
10 Apr 2006 10:36 AM
José_Manuel_Agüero
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.


Show quoteHide quote
"al jones" <alfredmjo***@shotmail.com> escribió en el mensaje news:1kl283q7asjsh$.k1az7aeh6hp0$.dlg@40tude.net...
| 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
Author
12 May 2006 9:15 AM
Nigel Borrill
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.

Show quoteHide quote
"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" <alfredmjo***@shotmail.com> escribió en el mensaje news:1kl283q7asjsh$.k1az7aeh6hp0$.dlg@40tude.net...
> | 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
>
Author
13 May 2006 10:29 AM
José_Manuel_Agüero
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.


Show quoteHide quote
"Nigel Borrill" <Agaric@community.nospam> escribió en el mensaje news:FEC89E47-4DC5-413E-BE54-F1B74F01D7AC@microsoft.com...
| 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" <alfredmjo***@shotmail.com> escribió en el mensaje news:1kl283q7asjsh$.k1az7aeh6hp0$.dlg@40tude.net...
| > | 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
| >