Change DEFAULT_FONT_NAME to User Defined Font Name

Bug #1099453 reported by Sergey Shtalin on 2013-01-14
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gEDA
Wishlist
Unassigned

Bug Description

By default gschem uses Arial font. This patch provides new parameter
in ~/.gEDA/gschemrc file for replace default font in gschem to user
defined font. After applying this patch and compiling sources you may
add to ~/.gEDA/gschemrc follow string:
(gschem-font-name "Your Font Name")
and gschem will draw text by your font. It will be usefull for drawing
schemes with Russian GOST.

Peter TB Brett (peter-b) wrote :

Nack. I won't apply this patch for two reasons:

1) It makes it impossible to instantiate a functional EdaRenderer object unless you tweak an apparently-unrelated, magic, non-reentrant variable. No changes to libgedacairo are required to implement this feature; you should just get gschem to set the "font-name" property on the EdaRenderer object that it uses.

2) Please use the EdaConfig mechanism rather than adding new gschemrc parameters. See the sources of `gaf export' for an example.

Changed in geda:
status: New → Won't Fix
importance: Undecided → Wishlist
tags: added: gschem
Vladimir Zhbanov (vzhbanov) wrote :

Peter, please look at the attached patch. Hopefully, it implements
the same functionality using the approach proposed by you.

Peter TB Brett (peter-b) wrote :

This is a lot tidier!

Setting the property makes a copy of the string, so you can free the font name straight away.

Also, I'm not sure whether it's worth allowing different fonts for display and export. What do you think? I'm sort of leaning in favour of the way you've set it up with just a single setting, TBH.

Changed in geda:
status: Won't Fix → In Progress
assignee: nobody → Peter TB Brett (peter-b)
assignee: Peter TB Brett (peter-b) → nobody
Vladimir Zhbanov (vzhbanov) wrote :

Are there any cases where a user wants the screen and printing
fonts to be different?

Such a situation was possible in older gschem versions if there
were no printing font corresponding to the used screen font in the
system. This was a Postscript printing issue. Doesn't cairo solve
this? And TBH, the need to set up the different font always was
very uncomfortable for me (I've spent so much time on this).

Now I see that cairo can even print fonts which are not present in
my system, that is, for instance, print italic version of a font
which doesn't contain italic glyphs. I like this feature very
much.

As a user, I'd always prefer to immediately see what will be
printed. And I believe most users would like to have WYSIWYG where
it is possible.

And in my opinion, if some user will want the printing font to be
different from the screen font (I don't believe that this will
happen), we can add the "font" key to the "gschem.printing" group
which will override the same setting in the "gschem" group.

As for the patch, I'm in doubt only what gschem group name should
be used in the config file ("gschem.common"?).

Alexey Shaposhnikov (avshap-3) wrote :

What about "gschem.graphical" as a group name? Because it looks the most suitable name for parameters such as font name, junction size or line width of nets and buses.

Vladimir Zhbanov (vzhbanov) wrote :

It is not only for gschem. 'gaf export' uses it, too. That is why
I'm in doubt. In this case, I'd prefer to have some toplevel
hierarchy group containing common keys shared by all gEDA/gaf
programs.

Alexey Shaposhnikov (avshap-3) wrote :

And by the way. May it would be better to to add "font-name" property in TEXT object, so that functions in libgeda and libgedacairo use it instead of constantly rereading config file?

On Sat, Dec 14, 2013 at 01:33:28PM -0000, Alexey Shaposhnikov wrote:
> And by the way. May it would be better to to add "font-name" property in
> TEXT object, so that functions in libgeda and libgedacairo use it
> instead of constantly rereading config file?

In fact, adding the new property to text objects means the sch/sym
format changing.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers