Re: [Fonts]fontconfig.org

2002-12-03 Thread Juliusz Chroboczek
J Dear webmaster of fontconfig.org and webmaster of
J xfree86.org/current/fonts.html, Juliusz Chroboczek

I'm merely the author of the latter document.  I am not a web site
maintainer (which I take is what ``webmaster'' means).

J 1) Please mention xft and FontConfig on this page, and describe what
J they are for, and how they relate to the rest of the information on
J www.xfree86.org/current/fonts.html

The document does explicitly state that RENDER fonts are not
described.  They will be in 4.3.0 if I have time to write a section.

Help is of course warmly welcome -- I didn't find anything on
fontconfig.org that is suitable for verbatim theft.

J In both cases you may consider to describe the mechanism of how a
J font-family choice (e.g. on a web-page) propagates to a unique fully
J specified X font-name of an installed font to be used to render the
J font (on the web-page).

Why do you believe that an XFree86 document should describe how your
web browser works?

Juliusz
___
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts



Re: [Fonts]Xft/fontconfig and Non-BMP characters

2002-12-03 Thread Jungshik Shin
On Sun, 1 Dec 2002, Jungshik Shin wrote:

 While trying to make Mozilla-Xft support non-BMP characters with fonts
 like CODE2001.TTF (with pid=3/eid=10 Cmap), I found that freetype
 and Xft need a little change. Details are sent to linux-utf8 list
 (http://mail.nl.linux.org/linux-utf8/2002-12/msg0.html) and Bugzilla

  Extending XftTextExtents16() to support UTF-16 is similar to

  Attached is my patch(a bit revised) to extend XftTextExtents16 to
support UTF-16 and to fix a typo in fstr.c of fontconfig(which makes the
conversion from UTF-16 to UCS-4 not work correctly for characters in
even numbered planes with the 17th bit in UTF-32 unset.)

  Keith, would you take a look?

  I also sent it to [EMAIL PROTECTED] and got a patch seq. #5522.

  Jungshik

___
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts



Re: [Fonts]Xft/fontconfig and Non-BMP characters

2002-12-03 Thread Jungshik Shin



On Tue, 3 Dec 2002, Jungshik Shin wrote:

   Attached is my patch(a bit revised) to extend XftTextExtents16 to
 support UTF-16 and to fix a typo in fstr.c of fontconfig(which makes the
 conversion from UTF-16 to UCS-4 not work correctly for characters in

  Sorry I forogot to attach it. This time, it's really attached.

  Jungshik

Index: xc/lib/fontconfig/src/fcstr.c
===
RCS file: /cvs/xc/lib/fontconfig/src/fcstr.c,v
retrieving revision 1.10
diff -u -r1.10 fcstr.c
--- xc/lib/fontconfig/src/fcstr.c   2002/08/31 22:17:32 1.10
+++ xc/lib/fontconfig/src/fcstr.c   2002/12/04 03:10:13
@@ -282,8 +282,8 @@
 */
if ((b  0xfc00) != 0xdc00)
return 0;
-   result = FcChar32) a  0x3ff)  10) |
- ((FcChar32) b  0x3ff)) | 0x1;
+   result = (FcChar32) a  0x3ff)  10) |
+ ((FcChar32) b  0x3ff))) + 0x1;
 }
 else
result = a;
Index: xc/lib/Xft/xftextent.c
===
RCS file: /cvs/xc/lib/Xft/xftextent.c,v
retrieving revision 1.9
diff -u -r1.9 xftextent.c
--- xc/lib/Xft/xftextent.c  2002/10/11 17:53:02 1.9
+++ xc/lib/Xft/xftextent.c  2002/12/04 03:10:14
@@ -147,6 +147,11 @@
free (glyphs);
 }
 
+#define IS_HIGH_SURROGATE(u) (((FcChar16) (u)  0xfc00L) == 0xd800L)
+#define IS_LOW_SURROGATE(u)  (((FcChar16) (u)  0xfc00L) == 0xdc00L)
+#define SURROGATE_TO_UCS4(h,l) (FT_UInt) (h)  0x03ffL)  10) | \
+((FT_UInt) (l)  0x03ffL)) + 0x1L)
+
 void
 XftTextExtents16 (Display  *dpy,
  XftFont   *pub,
@@ -156,6 +161,7 @@
 {
 FT_UInt*glyphs, glyphs_local[NUM_LOCAL];
 inti;
+intnglyphs = 0;
 
 if (len = NUM_LOCAL)
glyphs = glyphs_local;
@@ -169,8 +175,19 @@
}
 }
 for (i = 0; i  len; i++)
-   glyphs[i] = XftCharIndex (dpy, pub, string[i]);
-XftGlyphExtents (dpy, pub, glyphs, len, extents);
+{
+   if (IS_HIGH_SURROGATE(string[i])  i + 1  len  
+   IS_LOW_SURROGATE(string[i + 1]))
+   {
+   glyphs[nglyphs++] = XftCharIndex (dpy, pub, 
+   SURROGATE_TO_UCS4(string[i], string[i + 1])); 
+   ++i;
+   }
+   else 
+   glyphs[nglyphs++] = XftCharIndex (dpy, pub, string[i]);
+}
+
+XftGlyphExtents (dpy, pub, glyphs, nglyphs, extents);
 if (glyphs != glyphs_local)
free (glyphs);
 }



[Fonts]fontconfig

2002-12-03 Thread Tomas Pluskal

Hello, I've been trying to run mozilla with Xft on FreeBSD, and it always
segfaulted on startup (report below).

Then I found out I had to run fc-cache to make font.cache files in my
fonts directories, and everything works fine. But I believe that
fontconfig should not crash when these files are not present, should it?
:)

Thanks

Tomas Pluskal


gdb report from mozilla:
#0  0x0 in ?? ()
No symbol table info available.
#1  0x199d123b in FT_Get_Next_Char (face=0x8325400, charcode=0,
agindex=0xbfbfb8f4)
at
/usr/ports/print/freetype2/work/freetype-2.1.2/src/base/ftobjs.c:1614
result = 0
gindex = 0
driver = 0x832a280
#2  0x199a1b56 in FcFreeTypeCharSet () from
/usr/X11R6/lib/libfontconfig.so.1
No symbol table info available.
#3  0x199a4400 in FcFreeTypeQuery () from
/usr/X11R6/lib/libfontconfig.so.1
No symbol table info available.
#4  0x199a34ca in FcFileScan () from /usr/X11R6/lib/libfontconfig.so.1
No symbol table info available.
#5  0x199a37b6 in FcDirScan () from /usr/X11R6/lib/libfontconfig.so.1
No symbol table info available.
#6  0x1999cc90 in FcConfigBuildFonts () from
/usr/X11R6/lib/libfontconfig.so.1
No symbol table info available.
#7  0x199a4918 in FcInitLoadConfigAndFonts () from
/usr/X11R6/lib/libfontconfig.so.1
No symbol table info available.
#8  0x199a4971 in FcInit () from /usr/X11R6/lib/libfontconfig.so.1
No symbol table info available.
#9  0x1999cdbb in FcConfigGetCurrent () from
/usr/X11R6/lib/libfontconfig.so.1
No symbol table info available.
#10 0x1999e693 in FcConfigSubstituteWithPat () from
/usr/X11R6/lib/libfontconfig.so.1
No symbol table info available.
#11 0x1999eda2 in FcConfigSubstitute () from
/usr/X11R6/lib/libfontconfig.so.1
No symbol table info available.
#12 0x1990942e in nsFontMetricsXft::SetupFCPattern ()
   from /usr/X11R6/lib/mozilla-devel/components/libgfx_gtk.so
No symbol table info available.
...

___
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts