bug-gnustep
[Top][All Lists]
Advanced

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

Re: Full unicode support for back-xlib (2)


From: Kazunobu Kuriyama
Subject: Re: Full unicode support for back-xlib (2)
Date: Fri, 18 Jul 2003 11:04:03 +0900
User-agent: Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.0.0) Gecko/20020614

Hi Fred,

Thank you for reading the code very carefully and extensively.

Fred Kiefer wrote:

 > <snip>
 > - As XGFontSetEnumerator is currently not implemented I would remove
 > all reverences to it.

(Reading references for reverences,)
At first, I declared XGFontSetEnumerator without implementation, and
then I got an exception telling me that enumerateFontsAndFamilies should
be overridden.  So I put the stub of it to make the module work.
This is the only reason I did it.  If the declaration is unnecessary and
is the cause of throwing the exception, your suggestion is helpful to make
the implementation better.

 >
 > - [initWithFontName:matrix:screenFont:] may lead to memory leaks as
 > RELEASE(self) is missing for all the error cases.

That's simply due to my carelessness.

 >
 > - char_struct_for_glyph() could return a boolean value if the chracter
 > was found. Thereby making all the calls, especially [glyphIsEncoded:]
 > a lot simple and removing the need of memset() inside this function.

I agree.  This part of the currrent implementation looks quite agly.

 >
 > - My man pages warn about the use of the funtion strtok(). Why not
 > pass into load_font_set() the NSString and use
 > [componentsSeparatedByString:] (This method is also use in the
 > font_chacher.m)?
 > In this part of the code I am also a bit unsure about the pieces of
 > the XLFD that you use and the ones you discard. Could you explain,
 > document what you do and why? (For example, I would use the family and
 > discard the foundry, you do the opposit)

I guess your man pages tell you that strtok() modifies a given
original string, replacing a delimiter with a whitespace. Because
the current implmenetation invokes strtok() against a copy of the
original string, not the original one, I don't think the warning
makes the case.

I intentionally and extensively make use of the C library functions
over there because of efficiency.  As you can see, we need many
system calls and communications with the X server there, which
inevitably and significantly make programs crawl.  If this does
not make sense, I agree to the opinion that use of NSString would
be better.

Though the current code might look a bad programming style, I think
it is the right place to compromise.

As for the latter question: People can't expect every font on the earth
has the family property called 'Helvetica', 'Courier' or something
else which is taken for granted in Latin characters, while they can find
fonts with the foundry property such as 'Adobe' and 'fixed'..  The
current implementation reflects this reality.

(Because I thought this was a common knowledge, I didn't document
 it in detail.  This gives another example that people always think
 their own ways as 'the' standard, doesn't this?)

 > - What we could also think of is to make the switch between your and
 > the standard implementation of font handling one at runtime. Allowing
 > for a simpler transistion without recompiling the backend each time.
 > See the user default for the use of the XFT fonts.
 >

I'd like it if the development team would allow me to do so.  I guess we
need a new boolean user default value, say, GSEnableXFontSet or
GSXEnableFontSet (or, FontSet may be replaced with MultiByte).
Could you suggest me a better name?

- Kazu






reply via email to

[Prev in Thread] Current Thread [Next in Thread]