[kaffe] CVS kaffe (riccardo): changed default char back to Lucida
Kaffe CVS
cvs-commits at kaffe.org
Wed May 3 17:41:54 PDT 2006
PatchSet 7280
Date: 2006/05/04 00:29:34
Author: riccardo
Branch: HEAD
Tag: (none)
Log:
changed default char back to Lucida
Members:
ChangeLog:1.4784->1.4785
libraries/clib/awt/X/fnt.c:1.18->1.19
libraries/javalib/awt-implementations/kaffe/java/awt/Defaults.java:1.2->1.3
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4784 kaffe/ChangeLog:1.4785
--- kaffe/ChangeLog:1.4784 Tue May 2 20:38:47 2006
+++ kaffe/ChangeLog Thu May 4 00:29:34 2006
@@ -1,3 +1,10 @@
+2006-05-04 Riccardo Mottola <riccardo at kaffe.org>
+
+ * libraries/clib/awt/X/fnt.c:
+ fixed seriously broken charWidth implementation
+ * libraries/javalib/awt-implementations/kaffe/java/awt/Defaults.java:
+ changed default char back to Lucida
+
2006-05-02 Riccardo Mottola <riccardo at kaffe.org>
* libraries/javalib/awt-implementations/kaffe/java/awt/Font.java:
Index: kaffe/libraries/clib/awt/X/fnt.c
diff -u kaffe/libraries/clib/awt/X/fnt.c:1.18 kaffe/libraries/clib/awt/X/fnt.c:1.19
--- kaffe/libraries/clib/awt/X/fnt.c:1.18 Tue Oct 25 15:43:26 2005
+++ kaffe/libraries/clib/awt/X/fnt.c Thu May 4 00:29:38 2006
@@ -3,6 +3,8 @@
*
* Copyright (c) 1998
* Transvirtual Technologies, Inc. All rights reserved.
+ * Copyright (c) 2006
+ * Kaffe.org developers. See ChangeLog for details.
*
* See the file "license.terms" for information on usage and redistribution
* of this file.
@@ -215,11 +217,37 @@
return xfse->max_logical_extent.height-(-xfse->max_logical_extent.y);
}
+// We want to return a width if the font is fixed, else 0
KAFFE_FONT_FUNC_DECL( jint, Java_java_awt_Toolkit_fntGetFixedWidth )
{
- XFontSetExtents *xfse=XExtentsOfFontSet(UNVEIL_XOC(xoc));
- return ( xfse->max_logical_extent.width == xfse->max_ink_extent.width ) ?
- xfse->max_logical_extent.width : 0;
+ XFontSet *fontSet;
+ XFontStruct **fontStructList;
+ char **fontNameList;
+ fontSet = UNVEIL_XOC(xoc);
+ Atom atom;
+ unsigned long retValue;
+ char *atomValue;
+ int isFixedWidth;
+
+ // we create an atom to query the font properties
+ atom = XInternAtom( X->dsp, "SPACING", 0);
+
+ // we get the font structure
+ XFontsOfFontSet(fontSet, &fontStructList, &fontNameList);
+
+ isFixedWidth = 0;
+ if (XGetFontProperty(fontStructList[0], atom, &retValue)) {
+ atomValue = XGetAtomName(X->dsp, (Atom)retValue);
+ if (atomValue != NULL) {
+ if (atomValue[0] == 'C' || atomValue[0] == 'M') {
+ // we have a fixed with font
+ XFontSetExtents *xfse=XExtentsOfFontSet(fontSet);
+ return xfse->max_logical_extent.width;
+ }
+ }
+ XFree(atomValue);
+ }
+ return 0;
}
KAFFE_FONT_FUNC_DECL( jint, Java_java_awt_Toolkit_fntGetHeight )
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Defaults.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Defaults.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Defaults.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Defaults.java:1.2 Tue Apr 25 22:14:05 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Defaults.java Thu May 4 00:29:38 2006
@@ -423,8 +423,8 @@
int res = (ScreenWidth > 1024) ? 100 : 75;
String fntCat = Integer.toString(res) + '-' + res + "-*-*-*-*";
- //FsDefault = "-b&h-lucida-%s-%s-*-*-*-%d-" + fntCat;
- FsDefault = "-adobe-helvetica-%s-%s-*-*-*-%d-" + fntCat;
+ FsDefault = "-*-lucida-%s-%s-*-*-*-%d-" + fntCat;
+ //FsDefault = "-adobe-helvetica-%s-%s-*-*-*-%d-" + fntCat;
FsMonospaced = "-adobe-courier-%s-%s-*-*-*-%d-" + fntCat;
FsSansSerif = "-adobe-helvetica-%s-%s-*-*-*-%d-" + fntCat;
FsSerif = "-adobe-times-%s-%s-*-*-*-%d-" + fntCat;
More information about the kaffe
mailing list