[gcompris-devel] Font handling

Holger Kaelberer hk at elberer.de
Thu Sep 25 08:05:35 UTC 2014


Hi

On 09/25/2014 07:59 AM, JAZEIX Johnny wrote:
> Hi,
>
> the problem is to list files in the rcc. Once the rcc is created and in
> the package, we don't know which files are inside.

Indeed, the QResource-API does not include any way to inspect binary resource contents. Strange!

The QDir/QDirIterator et al. classes could be used to workaround this if we would assign a unique 
resource root path for each rcc file.

For example QDir(":/gcompris/data/voices/de/alphabet").entryList() gives me all my registered 
voices. Doing this recursively with QDirIterator on :/gcompris/data/voices/de/ would provide the 
results needed. Currently the resource root of voices-de.rcc is :/gcompris/data/voices/ (containing 
de/<file> entries), though, i.e. to be consistent we might want change this  to 
:/gcompris/data/voices/de ... and follow this convention everywhere.

Hum, might be easier to use your approach with a contents file. WDYT?

>
> I just thought that we can add a text file in the rcc we know the name
> and which list all the fonts we have besides. It won't be automatic (if
> someone does its own fonts.rcc he will have to update manually this file
> but is there a reason to do its own rcc and not put the fonts in the
> directories where Qt will look for them ?) but there will be no more the
> font names on the code.
>
> I can try to do a fonts.rcc like this:
> * fonts.txt
> * Andika.ttf
> * OpenDyslexic.otf
>
> Do you prefer it to be an external rcc (like the voices) or included by
> default rcc (like activities) ?

IMHO we should package it and not download it dynamically. Having a good default font in place from 
the very first start is important, I think. Currently the automaticDownloads setting is false by 
default on mobile devices (for the download volume generated otherwise automatically even on mobile 
data connections). Some might never change that and thus never get the default font.

If we download it, it would need to be integrated in the directory structure currently used in 
DownloadManager (something like gcompris/data/{fonts? data?/).

Holger

>
> If it is an external rcc, can we still set the Andika font by default
> (if the user can't download it, another default one will be used).
> When do we propose the user to download them ?
> * At first launching only (but if he wants after for another reason, he
> wno't be able to get them)
> * Button in configuration (like for the voices downloading : "download
> extra voices") ?
>
> If it is an included, it will be easier for me :-).
>
> Johnny
>
> On 09/24/14 00:16, Bruno Coudoin wrote:
>> Le 18/09/2014 12:13, Johnny Jazeix a écrit :
>>> Yes and no :). You need to specify in the source code the font names
>>> you want to add. I didn't find how to get all the filenames inside a
>>> rcc but if it is possible, we can add all the fonts in a rcc file
>>> dynamically (just tell in the source code to read fonts.rcc and add
>>> the font names to the list).
>>>
>>> For now, I added them in the core directory so we load them from the
>>> core.rcc file. Do you prefer another external rcc ?
>>>
>>>
>> Hi,
>>
>> What you did is good enough for now but it is possible to register an
>> rcc file and use a QDir to list files in a directory in it.
>>
>> Bruno.
>>
>> ------------------------------------------------------------------------------
>> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
>> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
>> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
>> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
>> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>> _______________________________________________
>> gcompris-devel mailing list
>> gcompris-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gcompris-devel
>
>
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> gcompris-devel mailing list
> gcompris-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gcompris-devel
>




More information about the Gcompris-devel mailing list