load richtexts and get missing fonts

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
sebastian1978
In need of some credit
In need of some credit
Posts: 7
Joined: Wed Jun 10, 2015 9:32 pm

load richtexts and get missing fonts

Post by sebastian1978 »

I'm saving richtexts to files and load them again.
If I load a file on another system, I have to check, if the containing fonts exists on this system.
Then a Message shall be shown, like Font x and y is missing on this system.

My Question:
Is there an easy way to check if some Fonts missing,
or have i get through the whole richtext and check for every font, if it exists?
jgrzybowski
Earned some good credits
Earned some good credits
Posts: 113
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: load richtexts and get missing fonts

Post by jgrzybowski »

I suppouse you are looking for following function:

Code: Select all

wxArrayString facenames = wxRichTextCtrl::GetAvailableFontNames();
Here you can find some example with this function:
http://src.gnu-darwin.org/ports/x11-too ... tspage.cpp

regards, Jarek
sebastian1978
In need of some credit
In need of some credit
Posts: 7
Joined: Wed Jun 10, 2015 9:32 pm

Re: load richtexts and get missing fonts

Post by sebastian1978 »

Thank you very much.

I hoped there's a function to get all used Font from a richtext-buffer.
Oh, maybe I found it:
wxRichTextBuffer::GetFontTable()

I only have to compare the fontnames from the buffer to the available fonts.
then i can show a message like:
"Missing Fonts: ..."
Post Reply