italic font on cairo devices in R 3.4

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

italic font on cairo devices in R 3.4

Ilia Kats
[cross-post from R-help]

Hi all,

I have the following problem: Since R 3.4.0, italic fonts rendered on
Cairo devices appear pixelated. Here's a minimal example:
cairo_pdf('test.pdf')
plot(1:10, ylab=expression(italic(test)))
dev.off()

The same problem occurs with bolditalic, but not bold. I am using Debian
Stretch. Several friends tried the same on their machines, another
Debian machine has the same problem. On MacOSX the output was not
pixelated, but it wasn't italic either. Ubuntu 16.04.2 xenial works
fine. My impression is that R somehow can't find the proper font to use
and falls back to something weird. Ideas?

Note that I'm not subscribed to the list, so please CC me in replies.

Cheers, Ilia

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: italic font on cairo devices in R 3.4

frederik
Hi Ilia,

I'm running Arch Linux, R 3.4.0.

Here's my test.pdf from your minimal example: https://ptpb.pw/HxsA.pdf

It doesn't look pixelated to me...

Here's a post that I wrote when I solved my last font problem in R,
almost 2 years ago:

https://stackoverflow.com/a/40940331/5087283

I had to install some Microsoft font packages, which is sad, because
there are some perfectly good free fonts that R could be using
instead. It could be considered a bug that R requires Microsoft fonts,
at least by default. However, does this even fix your problem? I.e. if
you install the corresponding Debian Microsoft font packages, does the
text appear anti-aliased?

Frederick

On Fri, Jul 07, 2017 at 10:30:46AM +0200, Ilia Kats wrote:

> [cross-post from R-help]
>
> Hi all,
>
> I have the following problem: Since R 3.4.0, italic fonts rendered on Cairo
> devices appear pixelated. Here's a minimal example:
> cairo_pdf('test.pdf')
> plot(1:10, ylab=expression(italic(test)))
> dev.off()
>
> The same problem occurs with bolditalic, but not bold. I am using Debian
> Stretch. Several friends tried the same on their machines, another Debian
> machine has the same problem. On MacOSX the output was not pixelated, but it
> wasn't italic either. Ubuntu 16.04.2 xenial works fine. My impression is
> that R somehow can't find the proper font to use and falls back to something
> weird. Ideas?
>
> Note that I'm not subscribed to the list, so please CC me in replies.
>
> Cheers, Ilia
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: italic font on cairo devices in R 3.4

Ilia Kats
Interesting. I did not have the package installed, but I did at some
point extract Helvetica from some MacOSX font files and R was using that
just fine until 3.3. This is how the plot looks in 3.4 (still using
Helvetica): https://ptpb.pw/HikX.pdf . After removing Helvetica,
installing the ttf-mscorefonts-installer package, and running fc-cache
--force  the plot looks like this: https://ptpb.pw/CM8A.pdf

Also note that the standard pdf device works fine:
https://ptpb.pw/3Ml1.pdf , it's just the cairo devices (both pdf and
svg) that have the issue. Unfortunately I need to use cairo_pdf due to
unicode characters in axis labels.

Cheers, Ilia


-------- Original Message --------
Subject: Re: [Rd] italic font on cairo devices in R 3.4
Date: 2017-07-07 18:17:34 +0200
From: frederik
To: Ilia Kats
CC: r-devel, r-help

> Hi Ilia,
>
> I'm running Arch Linux, R 3.4.0.
>
> Here's my test.pdf from your minimal example: https://ptpb.pw/HxsA.pdf
>
> It doesn't look pixelated to me...
>
> Here's a post that I wrote when I solved my last font problem in R,
> almost 2 years ago:
>
> https://stackoverflow.com/a/40940331/5087283
>
> I had to install some Microsoft font packages, which is sad, because
> there are some perfectly good free fonts that R could be using
> instead. It could be considered a bug that R requires Microsoft fonts,
> at least by default. However, does this even fix your problem? I.e. if
> you install the corresponding Debian Microsoft font packages, does the
> text appear anti-aliased?
>
> Frederick
>
> On Fri, Jul 07, 2017 at 10:30:46AM +0200, Ilia Kats wrote:
>> [cross-post from R-help]
>>
>> Hi all,
>>
>> I have the following problem: Since R 3.4.0, italic fonts rendered on Cairo
>> devices appear pixelated. Here's a minimal example:
>> cairo_pdf('test.pdf')
>> plot(1:10, ylab=expression(italic(test)))
>> dev.off()
>>
>> The same problem occurs with bolditalic, but not bold. I am using Debian
>> Stretch. Several friends tried the same on their machines, another Debian
>> machine has the same problem. On MacOSX the output was not pixelated, but it
>> wasn't italic either. Ubuntu 16.04.2 xenial works fine. My impression is
>> that R somehow can't find the proper font to use and falls back to something
>> weird. Ideas?
>>
>> Note that I'm not subscribed to the list, so please CC me in replies.
>>
>> Cheers, Ilia
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>

--
The first is to ensure your partner understands that nature has root
privileges - nature doesn't have to make sense.
-- Telsa Gwynne

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: italic font on cairo devices in R 3.4

frederik
On Fri, Jul 07, 2017 at 07:08:52PM +0200, Ilia Kats wrote:
> Interesting. I did not have the package installed, but I did at some point
> extract Helvetica from some MacOSX font files and R was using that just fine
> until 3.3. This is how the plot looks in 3.4 (still using Helvetica):
> https://ptpb.pw/HikX.pdf . After removing Helvetica, installing the
> ttf-mscorefonts-installer package, and running fc-cache --force  the plot
> looks like this: https://ptpb.pw/CM8A.pdf

The second plot looks worse, in other words, and the Microsoft fonts
didn't help.

Maybe the Cairo device should be giving better warning messages.

Anyway it sounds like you are describing a regression so maybe someone
can track down the commit that created this problem.

Thanks,

Frederick


> Also note that the standard pdf device works fine: https://ptpb.pw/3Ml1.pdf
> , it's just the cairo devices (both pdf and svg) that have the issue.
> Unfortunately I need to use cairo_pdf due to unicode characters in axis
> labels.
>
> Cheers, Ilia
>
>
> -------- Original Message --------
> Subject: Re: [Rd] italic font on cairo devices in R 3.4
> Date: 2017-07-07 18:17:34 +0200
> From: frederik
> To: Ilia Kats
> CC: r-devel, r-help
> > Hi Ilia,
> >
> > I'm running Arch Linux, R 3.4.0.
> >
> > Here's my test.pdf from your minimal example: https://ptpb.pw/HxsA.pdf
> >
> > It doesn't look pixelated to me...
> >
> > Here's a post that I wrote when I solved my last font problem in R,
> > almost 2 years ago:
> >
> > https://stackoverflow.com/a/40940331/5087283
> >
> > I had to install some Microsoft font packages, which is sad, because
> > there are some perfectly good free fonts that R could be using
> > instead. It could be considered a bug that R requires Microsoft fonts,
> > at least by default. However, does this even fix your problem? I.e. if
> > you install the corresponding Debian Microsoft font packages, does the
> > text appear anti-aliased?
> >
> > Frederick
> >
> > On Fri, Jul 07, 2017 at 10:30:46AM +0200, Ilia Kats wrote:
> > > [cross-post from R-help]
> > >
> > > Hi all,
> > >
> > > I have the following problem: Since R 3.4.0, italic fonts rendered on Cairo
> > > devices appear pixelated. Here's a minimal example:
> > > cairo_pdf('test.pdf')
> > > plot(1:10, ylab=expression(italic(test)))
> > > dev.off()
> > >
> > > The same problem occurs with bolditalic, but not bold. I am using Debian
> > > Stretch. Several friends tried the same on their machines, another Debian
> > > machine has the same problem. On MacOSX the output was not pixelated, but it
> > > wasn't italic either. Ubuntu 16.04.2 xenial works fine. My impression is
> > > that R somehow can't find the proper font to use and falls back to something
> > > weird. Ideas?
> > >
> > > Note that I'm not subscribed to the list, so please CC me in replies.
> > >
> > > Cheers, Ilia
> > >
> > > ______________________________________________
> > > [hidden email] mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-devel
> > >
>
> --
> The first is to ensure your partner understands that nature has root
> privileges - nature doesn't have to make sense.
> -- Telsa Gwynne
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: italic font on cairo devices in R 3.4

Paul Murrell-2
In reply to this post by Ilia Kats
Hi

Do you have the 'fonts-texgyre' (Debian) package installed?
If not, does installing that help?

Paul

On 07/07/17 20:30, Ilia Kats wrote:

> [cross-post from R-help]
>
> Hi all,
>
> I have the following problem: Since R 3.4.0, italic fonts rendered on
> Cairo devices appear pixelated. Here's a minimal example:
> cairo_pdf('test.pdf')
> plot(1:10, ylab=expression(italic(test)))
> dev.off()
>
> The same problem occurs with bolditalic, but not bold. I am using Debian
> Stretch. Several friends tried the same on their machines, another
> Debian machine has the same problem. On MacOSX the output was not
> pixelated, but it wasn't italic either. Ubuntu 16.04.2 xenial works
> fine. My impression is that R somehow can't find the proper font to use
> and falls back to something weird. Ideas?
>
> Note that I'm not subscribed to the list, so please CC me in replies.
>
> Cheers, Ilia
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

--
Dr Paul Murrell
Department of Statistics
The University of Auckland
Private Bag 92019
Auckland
New Zealand
64 9 3737599 x85392
[hidden email]
http://www.stat.auckland.ac.nz/~paul/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: italic font on cairo devices in R 3.4

Ilia Kats
Hi Paul,

thanks for your suggestion. No, I did not have that package installed,
but installing it didn't change anything, unfortunately.

Cheers, Ilia



-------- Original Message --------
Subject: Re: [Rd] italic font on cairo devices in R 3.4
Date: 2017-07-12 05:48:24 +0200
From: Paul Murrell
To: ilia-kats, r-devel

> Hi
>
> Do you have the 'fonts-texgyre' (Debian) package installed?
> If not, does installing that help?
>
> Paul
>
> On 07/07/17 20:30, Ilia Kats wrote:
>> [cross-post from R-help]
>>
>> Hi all,
>>
>> I have the following problem: Since R 3.4.0, italic fonts rendered on
>> Cairo devices appear pixelated. Here's a minimal example:
>> cairo_pdf('test.pdf')
>> plot(1:10, ylab=expression(italic(test)))
>> dev.off()
>>
>> The same problem occurs with bolditalic, but not bold. I am using
>> Debian Stretch. Several friends tried the same on their machines,
>> another Debian machine has the same problem. On MacOSX the output was
>> not pixelated, but it wasn't italic either. Ubuntu 16.04.2 xenial
>> works fine. My impression is that R somehow can't find the proper
>> font to use and falls back to something weird. Ideas?
>>
>> Note that I'm not subscribed to the list, so please CC me in replies.
>>
>> Cheers, Ilia
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>

--
Ha. I say let them try -- even vi+perl couldn't match the power of an
editor which is, after all, its own OS. ;-)
-- Johnie Ingram on debian-devel, about linking vim with libperl.so

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: italic font on cairo devices in R 3.4

Ilia Kats
In reply to this post by Paul Murrell-2
FYI, I now have a second confirmed Mac OS system (with R 3.4.1) where
the text is not rendered as italic.

Ilia



-------- Original Message --------
Subject: Re: [Rd] italic font on cairo devices in R 3.4
Date: 2017-07-12 05:48:24 +0200
From: Paul Murrell
To: ilia-kats, r-devel

> Hi
>
> Do you have the 'fonts-texgyre' (Debian) package installed?
> If not, does installing that help?
>
> Paul
>
> On 07/07/17 20:30, Ilia Kats wrote:
>> [cross-post from R-help]
>>
>> Hi all,
>>
>> I have the following problem: Since R 3.4.0, italic fonts rendered on
>> Cairo devices appear pixelated. Here's a minimal example:
>> cairo_pdf('test.pdf')
>> plot(1:10, ylab=expression(italic(test)))
>> dev.off()
>>
>> The same problem occurs with bolditalic, but not bold. I am using
>> Debian Stretch. Several friends tried the same on their machines,
>> another Debian machine has the same problem. On MacOSX the output was
>> not pixelated, but it wasn't italic either. Ubuntu 16.04.2 xenial
>> works fine. My impression is that R somehow can't find the proper
>> font to use and falls back to something weird. Ideas?
>>
>> Note that I'm not subscribed to the list, so please CC me in replies.
>>
>> Cheers, Ilia
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>

--
Linux - Where do you want to fly today?
-- Unknown source

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: italic font on cairo devices in R 3.4

Peter Dalgaard-2

> On 12 Jul 2017, at 18:41 , Ilia Kats <[hidden email]> wrote:
>
> FYI, I now have a second confirmed Mac OS system (with R 3.4.1) where the text is not rendered as italic.

Me three,

It affects cairo_pdf() only, plain pdf() renders the example just fine.

-pd

>
> Ilia
>
>
>
> -------- Original Message --------
> Subject: Re: [Rd] italic font on cairo devices in R 3.4
> Date: 2017-07-12 05:48:24 +0200
> From: Paul Murrell
> To: ilia-kats, r-devel
>> Hi
>>
>> Do you have the 'fonts-texgyre' (Debian) package installed?
>> If not, does installing that help?
>>
>> Paul
>>
>> On 07/07/17 20:30, Ilia Kats wrote:
>>> [cross-post from R-help]
>>>
>>> Hi all,
>>>
>>> I have the following problem: Since R 3.4.0, italic fonts rendered on Cairo devices appear pixelated. Here's a minimal example:
>>> cairo_pdf('test.pdf')
>>> plot(1:10, ylab=expression(italic(test)))
>>> dev.off()
>>>
>>> The same problem occurs with bolditalic, but not bold. I am using Debian Stretch. Several friends tried the same on their machines, another Debian machine has the same problem. On MacOSX the output was not pixelated, but it wasn't italic either. Ubuntu 16.04.2 xenial works fine. My impression is that R somehow can't find the proper font to use and falls back to something weird. Ideas?
>>>
>>> Note that I'm not subscribed to the list, so please CC me in replies.
>>>
>>> Cheers, Ilia
>>>
>>> ______________________________________________
>>> [hidden email] mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
> --
> Linux - Where do you want to fly today?
> -- Unknown source
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: [hidden email]  Priv: [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Loading...