RE: fonts




> > Has anyone ever seen a good tool for dealing with X font selection?
>
> The closest I have seen is Tk's font command.
>
> Federico and I talked about doing something for GNOME that would be
> similar.  At least the Canvas would be using that.
>
> I know I need something like that for the spreadsheet right now.
>
> Now, the spreadhseet is an interesting case:  I want to use only fonts
> that can be scaled to any size by the X server.  If anyone can give me
> a quick introduction on how to achieve this I will be eternally
> grateful.

This code is from the GtkFontSelection widget, and determines the type of
a font (scalable/bitmap) from an X fontname. 'pixels', 'points', 'res_x',
'res_y' correspond to the size and resolution fields in the X fontname.
(There is an X document describing these 'X Logical Font Descriptions' -
XLFD)

	  if (pixels == 0 && points == 0)
	    {
	      if (res_x == 0 && res_y == 0)
		  flags = SCALABLE_FONT;
	      else
		  flags = SCALABLE_BITMAP_FONT;
	    }
	  else
	    flags = BITMAP_FONT;

so you could do an XListFonts and check each font as above.

Or maybe I should add a function to GtkFontSelection so you can set a
filter so it only shows scalable fonts.

Damon




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]