[R] igraph_vertex

sibyiie@stoeckii m@iii@g oii gmx@ch sibyiie@stoeckii m@iii@g oii gmx@ch
Mon Feb 26 11:52:13 CET 2024

Dear Ivan

Thanks a lot.

I used:
windowsFonts(Helvetica = windowsFont("Helvetica"))
No warning now with Helvetica
Additionally I used "sans", similarly no warning  in the first part.

But still not able to open tiff with both versions:

Using "stress" as default layout
> dev.off()
TIFFOpen: figures/AES_network_bymembership.tiff: Cannot open.
Warning message:
In dev.off() :
  unable to open TIFF file 'figures/AES_network_bymembership.tiff'

Kind regards

-----Original Message-----
From: Ivan Krylov <ikrylov using disroot.org> 
Sent: Monday, February 26, 2024 10:15 AM
To: SIBYLLE STÖCKLI via R-help <r-help using r-project.org>
Cc: sibylle.stoeckli using gmx.ch
Subject: Re: [R] igraph_vertex

В Mon, 26 Feb 2024 09:02:56 +0100
SIBYLLE STÖCKLI via R-help <r-help using r-project.org> пишет:

> In the following code, which loads the tiff file, I get the following 
> error

This warning is definitely worth investigating, but it shouldn't interrupt your code. Does the figure come out wrong after you see this warning?

> In doTryCatch(return(expr), name, parentenv, handler) : Character set 
> family not found in the Windows character set database
> --> I am unsure if mySQL is the right solution. I have no experience
> how to change mySQL. 

I see you've tried to do the right thing and searched for the warning message. Unfortunately, the search engines are wrong; this doesn't seem related to MySQL.

A similarly-worded warning message exists in the Windows-related font functions inside R:

>> warning(_("font family not found in Windows font database"))

If running a sufficiently new version of R, try Sys.setLanguage('en') before reproducing the problem and searching for the exact warning message in double quotes. (Reset it back using
Sys.setLanguage(your_language_code) or restart R afterwards.) Translated error and warning messages are good for understanding, but they fragment the search engine results.

I see that a few messages back you set a font family:

>      vertex.label.family="Helvetica",

R probably doesn't know where to get it in order to render the plot as TIFF. If you have a copy of Helvetica installed in your system, try registering it using windowsFonts(Helvetica = windowsFont("how the font is named in the system")). (See help(windowsFonts) for more
information.) Otherwise you may be limited to R's predefined font families.

It's annoying that "Helvetica" exists for PDF plots and such seemingly without a problem, but if you change the output format to TIFF, the set of fonts available to you changes too. Unfortunately, there are multiple different font rendering engines in play, and their predefined lists of fonts also differ.

Best regards,

More information about the R-help mailing list