Better font dialog in Linux

Registered by Matthieu Amiguet on 2010-02-23

Use standard font dialog instead of file browser to chose font.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

In order to use the wx FontDialog instead of a simple file browser, we must be able to link the font name as returned by the FontDialog to a filename. The filename can be found with the command

fc-match -v <FontName> | sed -ne 's/.*file:\s*"\([^"]*\)".*/\1/p'

fc-match is part of the fontconfig toolsuite.

To find the font name,

fi.GetFaceName().replace(' ','')

seems to do the job.

This is ugly and might not be very robust, but nothing seems to exist to do it nicely...

Text size, weight, etc. still have to be treated separately.

Note: This is a robust solution in the sense that it should always return *some* filename (except if fc-match changes its output format). But there no guarantee that it will be the font that was really chosen in the dialog (although it seems to works for many fonts on my machine...)

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.