How do I use MS True type fonts on Linux? Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
katuday
Earned some good credits
Earned some good credits
Posts: 127
Joined: Fri Aug 17, 2012 2:22 am

How do I use MS True type fonts on Linux?

Post by katuday » Sun Oct 18, 2020 5:12 pm

Ubuntu 20.04
g++ 9.3
wxWidgets 3.1.4

I have installed Microsoft TrueType Fonts on Ubuntu.

How do I create a wxFont object with "Times-New-Roman" font?

The fonts is located here "/usr/share/fonts/truetype/msttcorefonts/Times-New-Roman.ttf"

The construction below picks a different font that looks awful

Code: Select all

wxFont font(32, wxFONTFAMILY_ROMAN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4430
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: How do I use MS True type fonts on Linux?

Post by ONEEYEMAN » Sun Oct 18, 2020 9:27 pm

Hi,
Why not assign faceName parameter appropriately?

Thank you.

katuday
Earned some good credits
Earned some good credits
Posts: 127
Joined: Fri Aug 17, 2012 2:22 am

Re: How do I use MS True type fonts on Linux?

Post by katuday » Sun Oct 18, 2020 10:40 pm

ONEEYEMAN wrote:
Sun Oct 18, 2020 9:27 pm
Hi,
Why not assign faceName parameter appropriately?

Thank you.
I tried this

Code: Select all

wxFont font(wxFontInfo(12).FaceName("Times-New-Roman"));
didn't work.

Update:

This works!
Face name is "Times New Roman" not "Times-New-Roman"

Post Reply