[Qgis-developer] Default typeface to package with app

Larry Shaffer larrys at dakotacarto.com
Sun Sep 16 12:27:18 PDT 2012


Hi Etienne,

On Sun, Sep 16, 2012 at 6:53 AM, Etienne Tourigny
<etourigny.dev at gmail.com> wrote:
> On Sat, Sep 15, 2012 at 8:51 PM, Larry Shaffer <larrys at dakotacarto.com> wrote:
>> 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.
>
> I guess I know pretty much nothing about fonts, but my understanding
> is that if DejaVu is installed (in linux), it's pretty certain the
> source is the official one, or else it would have another name?
> I understand this is not necessarily the case for other fonts.
>
> Most linux distros have a dejavu font package available, it's quite
> easy to add a dependency on that package and not ship the fonts with
> qgis.
>
> I guess an argument to always ship with them is to ensure that the
> right VERSION of the fonts is installed, or else some metrics might be
> different -
> in which case your argument makes sense. Could that be an issue?

Matching version is important, as you never know if the metrics have
been changed to fix a previous bug. But version matching isn't needed
if just a straight QFontMetrics comparison done (if installed doesn't
match, don't use it).

I don't foresee problems with the existing DejaVu in Linux distros,
since they haven't changed much recently, but metric-matching should
still take place. However, on Mac and Windows, it is not uncommon for
users to download fonts of either a similar name or outdated version.
Installing a font face of DejaVu from some other Web source than the
official page, or having the font installed sometime in the past by
some other software, often leaves users with a font of same name, but
possibly very different metrics.

Always packaging a standard font would skip those issues.

> Also the base package is already rather large (128MB for 1.8 osgeo4w
> standalone, 30MB for qgis-dev in osgeo4w), an extra 3MB isn't going to
> make much difference, given the benefits.

I agree. On Mac, compressed DMGs for QGIS/GDAL/GSL (absolute minimum
install) already totals at 117 MB. For my 'normal' Kyngchaos.com
setup, full install with extras (R/GRASS/PostgreSQL, etc), it totals
around 380 MB.

and from previous post...

>> As it stands now, there is no simple means for a user to switch the
>> app font, or font sizes for specific parts of the app. Once those
>> capabilities exist for users to switch fonts (possibly causing
>> numerous layout problem 'bug' reports from users), it would be
>> advantageous to always have a default font that the project
>> definitively knows works and has been tested across platforms, and one
>> that is not at the mercy of what Qt may select.
> ...
> it might be better not offering that choice  then, apart from font
> sizes, to avoid support problems.

I feel strongly both ways. :^)  Would be nice to offer the user a
choice (possibly allowing them use a font that 'just works' for their
OS). Then, it would help if people who support users know to tell the
user to switch to the default font for testing, but this doesn't
necessarily reduce the number of support issues, at first.

One solution might be to offer only the choice between Qt's default
and the preferred QGIS default font(s), but that seems a bit
restrictive for a modern app to me. It's a good goal to start with
though.

Regards,

Larry

> cheers
> Etienne
>
>>
>> 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