Update support for fonts

Jeff Weeks <[email protected]> Sat, 18 Feb 2006 12:36:02 -0500
Newsgroups gmane.comp.lang.eiffel.smalleiffel
Organization NeuralDK Software
Message-ID <[email protected]>
Hello,

Over the past week or so I've been slowly creating a NOTEBOOK widget similar 
to ISE's EV_NOTEBOOK.  In the process, I required support for rotating fonts.

I've implemented a quick interface for these and would like to share to the 
list for comments (José has already agreed to take a look at them, but I 
figured I'd also forward to the list in case anyone's interested).

Because of the separation between logical fonts (which is, effectively, a font 
name) and a styled font (a logical font coupled with a size, angle, bold or 
italics, etc) I've created a FONT_STYLE class.

Creation of a BASIC_FONT has changed such that you can now actually select a 
type face from name.  When a FONT_STYLE is applied then the existing 
(windows) font is destroyed and a new one is created with the appropriate 
styling.  I've also implemented code in order to tell if a windows typeface 
actually exists.

Support is only for windows, currently, because the X11 support will be a fair 
bit more involved (requiring me to actually manually rotate an XImage... not 
overly difficult, but I've left it out for the time being).

There is one drawback with the current implementation.  If one creates a 
FONT_STYLE and applies it to a BASIC_FONT via set_style, and then edits the 
FONT_STYLE object, the changes do not immediate take effect to the BASIC_FONT 
object (set_style must be called again).

In the zip:
  basic_font.e - replaces lib/vision/basic_font.e
  font.c - replaces sys/plugins/vision/font/c/font.c
  font.h - replaces sys/plugins/vision/font/c/font.h
  font_style.c - new, in sys/plugins/vision/font_style/c/
  font_style.e - new, in lib/vision
  font_style.h - new, in sys/plugins/vision/font_style/c/

All comments welcome.

Thanks,
--Jeff
font_edits.zip (application/x-zip, 6.8 KB) - not displayed