[Eric] font settings shift when saving a new file

Detlev Offenbach detlev at die-offenbachs.de
Tue Jul 22 17:37:40 BST 2008


On Montag, 21. Juli 2008, Darren Dale wrote:
> Hi Detlev,
>
> On Monday 21 July 2008 01:32:20 pm Detlev Offenbach wrote:
> > On Montag, 21. Juli 2008, Darren Dale wrote:
> > > Hello,
> > >
> > > When I create a new file, the fonts initially respect the settings from
> > > the preferences dialog, which is DejaVu Sans Mono (same font for all
> > > eric4's fonts, and I have the "use monospace as default" box checked).
> > > When I save this new file (as .py or .c, for example), the fonts change
> > > from monospaced to some kind of sans serif. If I close the file and
> > > reopen it, I get the monospaced fonts back.
> > >
> > > Its a minor issue, but its been around for as long as I can remember. I
> > > probably should have reported it earlier. I'm currently using the 4.2
> > > release candidate.
> >
> > In order to track it down, I have to have more info.
> >
> > 1. When you edit the file, what is the language set to?
>
> How do I find this information? I think it is english utf8, and my locale
> is US_en, which eric complains about when I start from the command line:
>
> Warning: translation file 'qt_en_US'could not be loaded.
> Using default.
> Warning: translation file 'eric4_en_US'could not be loaded.
> Using default.
> Warning: translation file 'qscintilla_en_US'could not be loaded.
> Using default.

Oops, I meant the programming language, e.g. Python (see editor context menu, 
Language)

>
> > 2. Do you have a lexer configured for e.g. Python (if saving to .py)?
>
> yes, I am using the defaults and .py is set to Python, c to C++
>
> > 3. Is there a font set to a kind of sans serif?
>
> No, all my fonts are set to DejaVu sans mono.
>
> > 4. If possible step by step instructions because I haven't seen this yet.
>
> It's really simple to run into on my machine:
>
> open eric
> click file->new button or menu option
> type jibberish
> save as .py
> fonts have changed

That is normal beacuse:

1. When file is opened, it is not associated with a lexer. Therefore, the 
default font is used (see Editor->Styles configuration page).
2. When it is saved as .py, it is associated with the Python lexer and the 
fonts and colors of this lexer is used.

Does this explain your observation?

Regards,
Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the Eric mailing list