FreeType looses font styles on save/load (with patch)
- From: Harvey and Su Thompson <harveyandsu yahoo com>
- To: dia-list gnome org
- Subject: FreeType looses font styles on save/load (with patch)
- Date: Fri, 21 Jun 2002 12:08:23 +0100 (BST)
Hi all,
I'm currently using dia-0.90 to produce some UML class and sequence diagrams
for my MSc -- I was recommended it by a work colleage and it seems to do
exactly what I need. I'm running on SuSE 8.0 and compiled with FreeType
support, since it SEGV as described elsewhere in the mailing list.
Anyways, I've noticed it doesn't save the font styles for diagrams. Mostly
notably abstract classes loose their italics (all the fonts loose their
boldness which is less important). Quick glance shows that this is FreeType
specific, and I've included a small patch to save/load the style, which seems
to work for me.
Keep up the good work! With this and OpenOffice I'm free at last!!!
Harvey Thompson
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
*** dia_xml.c~ Thu May 23 17:55:15 2002
--- dia_xml.c Fri Jun 21 11:43:46 2002
***************
*** 651,656 ****
--- 651,657 ----
data_font(DataNode data)
{
char *name;
+ char *style;
DiaFont *font;
if (data_type(data)!=DATATYPE_FONT) {
***************
*** 659,665 ****
--- 660,676 ----
}
name = xmlGetProp(data, "name");
+ #ifdef HAVE_FREETYPE
+ style = xmlGetProp(data, "style");
+ if (style == NULL) {
+ font = font_getfont(name);
+ } else {
+ font = font_getfont_with_style(name, style);
+ xmlFree(style);
+ }
+ #else
font = font_getfont(name);
+ #endif
if (name) xmlFree(name);
return font;
***************
*** 841,846 ****
--- 852,860 ----
data_node = xmlNewChild(attr, NULL, "font", NULL);
xmlSetProp(data_node, "name", font->name);
+ #ifdef HAVE_FREETYPE
+ xmlSetProp(data_node, "style", font->style);
+ #endif
}
DataNode
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]