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.
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

Postby sebastian1978 » Tue Sep 01, 2015 1:28 pm

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: 103
Joined: Sat Sep 24, 2011 9:32 pm
Location: Poland

Re: load richtexts and get missing fonts

Postby jgrzybowski » Tue Sep 01, 2015 5:15 pm

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-toolkits/py-wxPython28-common/work/wxPython-src-2.8.4.0/src/richtext/richtextbulletspage.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

Postby sebastian1978 » Wed Sep 02, 2015 9:40 am

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: ..."


Return to “wxDev-C++”

Who is online

Users browsing this forum: No registered users and 1 guest