[Qgis-developer] Default typeface to package with app

Larry Shaffer larrys at dakotacarto.com
Sat Sep 15 16:51:33 PDT 2012


Hi Etienne,

On Sat, Sep 15, 2012 at 3:59 PM, Etienne Tourigny
<etourigny.dev at gmail.com> wrote:
> It seems quite a few linux distros have dejavu packages available, so
> it's probably not worth worrying about for the linux packages:
> http://dejavu-fonts.org/wiki/Download
>
> It seems that Deja Vu is similar to or compatible with Verdana - which
> is more widely available in Windows and OS X ?

It's not a question of similarity or availability. The font should be
an exact metrics match or some loss of advantages will occur,
especially when considering it might be used for label engine output
tests or for other purposes not yet visualized. It's not about syncing
up with availability, it's about control.

> If we end up embedding fonts (in say Windows and OSX), it might be
> worth only embedding what is really necessary to save some space.
> If you need only 4 typefaces (out of 21 total), then download size
> would be about 1MB instead of 5MB.

I would be in favor of QGIS only using a sans-serif font, as default.
If the DejaVu serif and 'extra light' faces are dropped, the
compressed size is just over 3 MB. Fairly reasonable size, I think, to
ship with every release to ensure complete compatibility.

The only time I see the inclusion of the 3MB as a waste is if the
distro install of DejaVu fonts *exactly* match the provided ones. Then
the provided ones would not be loaded into QFontDatabase to avoid
duplication conflicts (similar to as if the user decided to install
the provided font). IMHO it would be easier to always ship the font
with releases and just code to see if the installed DejaVu font is a
match, than to maintain packaging knowledge and coding for which
platform has a compatible version of DejaVu installed.

Regards,

Larry

> Etienne
>
> On Sat, Sep 15, 2012 at 6:46 PM, Etienne Tourigny
> <etourigny.dev at gmail.com> wrote:
>> Hi Larry,
>>
>> I agree with using a unique font - but it would be best to choose one
>> which would minimize the need to add size to qgis.
>>
>> For example, deja vu font has packages in ubuntu (to name one linux
>> distro), so adding it as an external dependency would not add size to
>> the qgis package.
>> Don't know about windows, osx and other linux distros though. Any case
>> we could provide an extra package, to be installed when needed.
>>
>> On another note - do you plan to allow user to choose his font of
>> choice, or hard-code a specific font - based on all your arguments
>> above?
>>
>> Etienne
>>
>> On Sat, Sep 15, 2012 at 5:33 PM, Larry Shaffer <larrys at dakotacarto.com> wrote:
>>> Hi,
>>>
>>> Not sure if this has been discussed before, but how about including a
>>> default typeface to package with releases/source? Here are several
>>> reasons for doing so:
>>>
>>> * Standard QFontMetrics allow for developing a GUI overhaul around a
>>> known font across all platforms (at least in a pointsize at dpi default
>>> sense).
>>> * Known font metrics allow for standardizing relative font sizes in
>>> app-wide stylesheets, and per platform where needed.
>>> * Adding tests for the labeling engine would need a standard font of
>>> consistent metrics and available/functional on all platforms.
>>> * Currently the only Qt default font on all platforms (Courier, I
>>> believe) is not necessarily of similar metrics, since it is from
>>> various sources, nor is it IMHO very nice looking (apologies to any
>>> Courier fans).
>>> * Have a better/consistent monospaced font for the Python Console and
>>> anywhere editor instances (e.g. QScintilla2) or code snippets are
>>> displayed.
>>> * Have a known set of available Unicode glyphs for translators to rely upon.
>>> * Have a default font that provides a known set of Unicode glyphs for
>>> font markers in symbology. (Could be spread across multiple default
>>> symbol fonts.)
>>> * Provide workarounds for QtDesigner bug where platform-specific fonts
>>> end up embedded in .ui files [0].
>>>
>>> There are probably other good reasons. I've looked at several typeface
>>> candidates and think the DejaVu project's family of fonts [1] would
>>> work well. While DejaVu (based off of Bitstream's Vera Sans) is
>>> already available for Ubuntu and other Linux distros, it is relatively
>>> unused, though fully compatible, on all supported QGIS platforms [2].
>>> Downside: about 5 MBs extra (compressed) for package.
>>>
>>> As a TTF DejaVu can readily be loaded into QFontDatabase [3] on
>>> platforms that do not have a compatible DejaVu typeface already
>>> installed. This would probably entail only loading 4 heavily-used
>>> faces, like Sans Book/Bold and Mono Book/Bold, though I think the
>>> entire typeface should be included.
>>>
>>> Any other ideas for embedded fonts? Note: fonts to consider should be
>>> in TTF format, offer enough font faces, provide enough language and
>>> Unicode character support, and be available under the SIL Open Font
>>> [4] or similarly compatible license.
>>>
>>>
>>> [0] Search for 'font-family:' in .ui files
>>> [1] http://dejavu-fonts.org/wiki/Main_Page
>>> [2] http://en.wikipedia.org/wiki/DejaVu_fonts
>>> [3] http://qt-project.org/doc/qt-4.7/qfontdatabase.html#id-5441ac2b-3b52-411e-b2be-7ee83eef8041
>>> [4] http://en.wikipedia.org/wiki/SIL_Open_Font_License
>>>
>>> Regards,
>>>
>>> Larry
>>> _______________________________________________
>>> Qgis-developer mailing list
>>> Qgis-developer at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list