Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Matlab font problem in gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
muebi
Guru
Guru


Joined: 07 Nov 2008
Posts: 312

PostPosted: Tue May 03, 2011 5:15 pm    Post subject: Matlab font problem in gentoo Reply with quote

Hi,

I have problems with my matlab installation on gentoo. The problem is that I cannot change the size or type of fonts. No matter how I try to edit or modify them they always come out the same. I read in a thread at mathworks that this problem may be related to missing fonts. Did anybody run into this problem and knows how to fix it?

Thanks.
Back to top
View user's profile Send private message
muebi
Guru
Guru


Joined: 07 Nov 2008
Posts: 312

PostPosted: Tue Jun 21, 2011 11:08 pm    Post subject: Reply with quote

Hi,

I wanted to give an update on this issue. The problem I am having is that I cannot change font size or font type in matlab figure windows as they appear on the screen. Consequently, if I save as png or gif they will always display with the tiny default matlab font size, which is awful. If I save the figure as eps everything is fine and the font size changes are properly applied.

I believe that this issue it related to missing font packages or X or similar but I have no idea which packages I am missing.

If anybody has a suggestion or suspicion what may cause the problem please post!!!

I am also in touch with folks at mathworks but so far nothing conclusive from that side.
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 523
Location: Connecticut, USA

PostPosted: Tue Jun 21, 2011 11:38 pm    Post subject: Reply with quote

Pretty much grasping at straws, but first, does Matlab have any font configuration dialogs? If so, see if there are any keywords in font names you might link with some font package in Gentoo. Second, try running Matlab from the command line (or check the log with maximum verbosity for logging) to see if there are any error messages about fonts not found. There might also be an error in the X log (/var/log/Xorg.0.log probably).
Back to top
View user's profile Send private message
muebi
Guru
Guru


Joined: 07 Nov 2008
Posts: 312

PostPosted: Thu Jun 23, 2011 9:10 pm    Post subject: Reply with quote

I have lines like the ones below in my Xorg.0.log file. Does that look suspicious?

Code:
[    18.024] (WW) The directory "/usr/share/fonts/TTF/" does not exist.
[    18.024]    Entry deleted from font path.
[    18.024] (WW) The directory "/usr/share/fonts/OTF/" does not exist.
[    18.024]    Entry deleted from font path.
[    18.024] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[    18.024]    Entry deleted from font path.
[    18.025] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
[    18.025]    Entry deleted from font path.
[    18.025]    (Run 'mkfontdir' on "/usr/share/fonts/100dpi/").
[    18.025] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
[    18.025]    Entry deleted from font path.
[    18.025]    (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").
[    18.025] (==) FontPath set to:
   /usr/share/fonts/misc/
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 523
Location: Connecticut, USA

PostPosted: Thu Jun 23, 2011 9:25 pm    Post subject: Reply with quote

Unfortunately, I don't think so, and I get the TTF and OTF messages also. Those directories seem to be in the default built in font path, but not included in recent distributions. For the last two, if you do have the 100dpi and 75dpi directories, you can run mkfontdir in each of them (as root, I believe) but I'm not sure that will have any real effect other than eliminating that error message. However, look in that log file, just below those errors, for the list of directories actually used in the font path, and make sure there aren't other font directories that are NOT used. If there is a dir with the matlab fonts, that X is not including, I think you have to manually include it in xorg.conf or some file in xorg.conf.d, but I haven't even done that myself. (I don't have Matlab, and I'm not obviously missing any fonts.)
Back to top
View user's profile Send private message
Pakz0rz
n00b
n00b


Joined: 24 Jun 2011
Posts: 2

PostPosted: Fri Jun 24, 2011 3:40 pm    Post subject: Reply with quote

Hi,

I've run into the same problem multiple times. I've found the following on Archwiki: https://wiki.archlinux.org/index.php/Matlab
Although it is about installing MATLAB 32 bit on a 64 bit system, I guess you could still try to install all the libraries mentioned in the article and see if they work. I don't know how different the library names are compared to Gentoo though, it might take some searching.
I can't test it myself as I'm not running Gentoo at the moment. If it works, I will probably be installing Gentoo again on my laptop.

Hope this helps,
Pakz0rz
Back to top
View user's profile Send private message
muebi
Guru
Guru


Joined: 07 Nov 2008
Posts: 312

PostPosted: Fri Jun 24, 2011 4:53 pm    Post subject: Reply with quote

Pakz0rz,

I looked at this guide and checked all the libraries but I have all of them installed. It must be something else then...
Back to top
View user's profile Send private message
muebi
Guru
Guru


Joined: 07 Nov 2008
Posts: 312

PostPosted: Fri Jun 24, 2011 6:35 pm    Post subject: Reply with quote

genterminl,

I tried the mkfontdir command to get rid of the error messages related to 100dpi and 75dpi fonts and it worked.
The fontspath lines are the following now:

[ 18.006] (==) FontPath set to:
/usr/share/fonts/misc/,
/usr/share/fonts/100dpi/,
/usr/share/fonts/75dpi/

Are these the lines you're interested in?

Unfortunately, fixing the 100dpi and 75dpi fonts didn't solve my problem.
Back to top
View user's profile Send private message
genterminl
Guru
Guru


Joined: 12 Feb 2005
Posts: 523
Location: Connecticut, USA

PostPosted: Fri Jun 24, 2011 9:59 pm    Post subject: Reply with quote

muebi,

No, none of those three font dirs look like they would have anything to do with Matlab. However, I suggest you look at the link provided by Pakz0rz. I know that archlinux and Gentoo are different - but you might see if any of the package names match ebuilds you don't have installed - for example freetype. That also sounds like a possibility since it is not included in your X fontpath.
Back to top
View user's profile Send private message
Pakz0rz
n00b
n00b


Joined: 24 Jun 2011
Posts: 2

PostPosted: Sat Jul 16, 2011 10:42 am    Post subject: Reply with quote

Sorry for replying to an oldish thread. I've managed to find some sort of work-around (although in Arch linux, I guess it should be the same for Gentoo since it is the exact same problem):
In MATLAB, type "listfonts" to see a list of available fonts. Some of the fonts listed here seem to work, others not. If I set the fonts in my title to 'freesans' everything works fine: the font face and size are displayed correctly. Other fonts (e.g. 'courier') do not work. Then MATLAB defaults to the standard monospaced font with font size 6 or something.
Therefore I guess that the problem lies with either not having the correct fonts installed, or that MATLAB is somehow unable to acces these fonts.
Back to top
View user's profile Send private message
Superfox_il_Volpone
n00b
n00b


Joined: 14 Aug 2012
Posts: 47

PostPosted: Tue Aug 21, 2012 11:35 am    Post subject: Reply with quote

Hi guys,
I faced the same issue above, caused by two different problems. The former is that I had the fonts in fontconfig fc-list but not X11. You are in the same situation if the output of xlsfonts is:
Code:

-misc-fixed-medium-r-semicondensed--0-0-75-75-c-0-iso8859-1
-misc-fixed-medium-r-semicondensed--13-100-100-100-c-60-iso8859-1
-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
6x13
cursor
fixed

You may need to "emerge" the application before (x11-apps/xlsfonts) .

In this case edit xorg.conf adding a section to list the font directories as seen from fc-list. E.g. :
Code:

Section "Files"
        ModulePath "/usr/lib/xorg/modules" # I don't think you need it
        FontPath "/usr/share/fonts/cantarell"
        FontPath "/usr/share/fonts/dejavu"
        FontPath "/usr/share/fonts/unifont"
        FontPath "/usr/share/fonts/urw-fonts"
EndSection


Then restart x (or reboot) and check again with xlsfonts if fonts have been installed.

The second problem is the one reported by Pakz0rz, you may have not these default fonts:
Code:

'AvantGarde'
    'Bookman'
    'Courier'
    'Helvetica'
    'Helvetica-Narrow'
    'NewCenturySchoolBook'
    'Palatino'
    'Symbol'
    'Times'
    'ZapfChancery'
    'ZapfDingbats'

You should be able to change the font with another installed in the previous step.
To make this setting permanent add it in the startup.m file $MATLAB/toolbox/local/startup.m (see http://www.mathworks.com/matlabcentral/answers/1238):
Code:
 
set(0,'defaultAxesFontName', 'Your font name')
set(0,'defaultTextFontName', 'Your font name')


AFAIK this mess comes because matlab figure directly relies on X11 and does not take into account fontconfig. This should also explain why the font aliases do not work.

Hope it helps
-sfox
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum