Long delay in first use of fontconfig features in gd terminal in my MinGW build

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Long delay in first use of fontconfig features in gd terminal in my MinGW build

tmacchant
Hello

This is not a bug but a slightly annoying matter.

For the gnuplot binaries for windows built by me,
If I use fontconfig features in gd terminal for example

gnuplot> set term png font 'Times New Roman'

If it is used for the first time, a long delay happes in first use.
(depending on environment. ca. several ten seconds).

However, once the fontconfig features is used, delay does not occur.

For cairo based terminal, this delay does not occur.

For the binary provided by Bastian, this delay does not occur.

Have anyone seen the similar issue?

Tatsuro   

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
gnuplot-beta mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
Reply | Threaded
Open this post in threaded view
|

Re: Long delay in first use of fontconfig features in gd terminal in my MinGW build

Mojca Miklavec
On 15 February 2016 at 09:24, Tatsuro MATSUOKA wrote:

> Hello
>
> This is not a bug but a slightly annoying matter.
>
> For the gnuplot binaries for windows built by me,
> If I use fontconfig features in gd terminal for example
>
> gnuplot> set term png font 'Times New Roman'
>
> If it is used for the first time, a long delay happes in first use.
> (depending on environment. ca. several ten seconds).
>
> However, once the fontconfig features is used, delay does not occur.
>
> For cairo based terminal, this delay does not occur.
>
> For the binary provided by Bastian, this delay does not occur.
>
> Have anyone seen the similar issue?

On all systems with libraries that use fontconfig, fontconfig has to
scan all system fonts occasionally. On Linux that most likely happens
semi-automatically somewhere in the background and only once for all
applications. On Mac and Windows this is a bit more tricky because
every single piece of software uses its own copy of fontconfig and its
own database. The described behaviour is a well known "problem". On OS
X many software packages like MPlayer, VNC, Gimp, ... would display a
notice when I start them, letting me know that I have to wait until
the font database gets rebuilt/updated.

I don't believe that you can entirely avoid that. You can probably
influence the frequency of updates and location of the database. Maybe
your build of fontconfig creates a font database at some temporary
location that Windows deletes when you shut down the computer (that is
pure guessing). In any case you should not get delays every time you
start gnuplot.

I don't understand why the delay happens with gd, but not with cairo
though (if both use fontconfig). I would expect a delay with every
terminal that depends on fontconfig, but only once in a while (maybe
once per month or when you try to use a font that's not in the
database).

Mojca

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
gnuplot-beta mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
Reply | Threaded
Open this post in threaded view
|

Re: Long delay in first use of fontconfig features in gd terminal in my MinGW build

tmacchant
----- Original Message -----

> From: Mojca Miklavec 
> To: Tatsuro MATSUOKA 
> Cc: gnuplot-beta 
> Date: 2016/2/15, Mon 17:45
> Subject: Re: Long delay in first use of fontconfig features in gd terminal in my MinGW build
>
> On 15 February 2016 at 09:24, Tatsuro MATSUOKA wrote:
>>  Hello
>>
>>  This is not a bug but a slightly annoying matter.
>>
>>  For the gnuplot binaries for windows built by me,
>>  If I use fontconfig features in gd terminal for example
>>
>>  gnuplot> set term png font 'Times New Roman'
>>
>>  If it is used for the first time, a long delay happes in first use.
>>  (depending on environment. ca. several ten seconds).
>>
>>  However, once the fontconfig features is used, delay does not occur.
>>
>>  For cairo based terminal, this delay does not occur.
>>
>>  For the binary provided by Bastian, this delay does not occur.
>>
>>  Have anyone seen the similar issue?
>
> On all systems with libraries that use fontconfig, fontconfig has to
> scan all system fonts occasionally. On Linux that most likely happens
> semi-automatically somewhere in the background and only once for all
> applications. On Mac and Windows this is a bit more tricky because
> every single piece of software uses its own copy of fontconfig and its
> own database. The described behaviour is a well known "problem". On OS
> X many software packages like MPlayer, VNC, Gimp, ... would display a
> notice when I start them, letting me know that I have to wait until
> the font database gets rebuilt/updated.
>
> I don't believe that you can entirely avoid that. You can probably
> influence the frequency of updates and location of the database. Maybe
> your build of fontconfig creates a font database at some temporary
> location that Windows deletes when you shut down the computer (that is
> pure guessing). In any case you should not get delays every time you
> start gnuplot.
>
> I don't understand why the delay happens with gd, but not with cairo
> though (if both use fontconfig). I would expect a delay with every
> terminal that depends on fontconfig, but only once in a while (maybe
> once per month or when you try to use a font that's not in the
> database).
>
> Mojca


Thanks for your detailed explanation.

> I don't understand why the delay happens with gd, but not with cairo
> though (if both use fontconfig).


For cairo based terminal, it is possible that I might make mistakes.

First I have tried used enhanced text handing on gd terminals.

set term png
set out 'test.png'
set title '{/:Bold A}'
plot sin(x)
set out

First I felt that gnuplot hanged.

For pngcairo

set term pngcairo
set out 'test.png'
set title '{/:Bold A}'
plot sin(x)
set out

worked as expected

But I did not execute

set term pngcairo font 'Times New Roman'

Other fontconfing application like fc-list have long delay in first use.
You explanation is quite right for windows.

Tatsuro 

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
gnuplot-beta mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta