On 8/12/07, Fred Kiefer <[EMAIL PROTECTED]> wrote:
> I tried both the AR PL fonts and they seem to work for me. The problem
> you reported in the other mail was when creating the character set, not
> when checking if a character was included. Perhaps you could send me
> your test file. At the moment I am not able to reproduce the problem.
>
> Excluding some fonts from the check wont be an option as people may want
> to use this fonts anyway and then we have the same problem. We really
> need to find out, what is going wrong here.
>
> And GNUstep should be able to support all Unicode characters, if not we
> need to change this. From looking at the code I see no limitation.
Here is the text I used. It is in UTF-8 encoding.
You need a Chinese font (AR PL...)
and another font which has better coverage than usual,
probably one of the DejaVu font for a row of symbol in the bottom.
Yen-J
>
> Cheers,
> Fred
>
> Yen-Ju Chen wrote:
> > On 8/11/07, Fred Kiefer <[EMAIL PROTECTED]> wrote:
> >> Thank you for the patches. I already applied the first one. For the
> >> other two I would like to understand the problem they try to solve a bit
> >> better, before working around it.
> >>
> >> The illegal value for the character set are really strange. The value
> >> GNUstep checks against is 1114112, which should be the maximal allowed
> >> UNICODE value. I could understand, if GNUstep would be off by one. Could
> >> you please test this or send me such a font, then I would have a look
> >> myself.
> >
> > I use the font here:
> > http://download.gna.org//etoile/etoile-default-fonts.tar.gz
> > One of the Chinese font (AR PL...) is broken.
> > Actually there are two possibility.
> > NSCharacterSet support longCharacterIsMember:,
> > which take 32-bit integer instead of unichar (16-bit).
> > It indicates that unicode can go beyond 16-bit.
> > If I use -longCharacterIsMember: to get font coverage,
> > it complains something is too big.
> > So I suspect either GNUstep cannot support 32-bit glyph,
> > or the font has a wrong table inside.
> > Actually it happens to me some time ago with another set of fonts.
> > Considering the nature of open source,
> > I am not surprised that some of the font has the wrong table inside.
> > For art backend, we have limited nfont packages.
> > So it is not a big problem to find the bad one and remove it.
> > But for cairo backend, it gets all fonts from X, which is a LOT.
> > What's the chance of any of them has broken table inside ?
> > So the purpose of not using all availbe fonts is
> > 1. users can control which fonts to use and avoid bad font from system.
> > 2. GNUstep may not support for font beyond 16-bit glyph (maybe).
> > And I really don't see what we can get from using all available
> > fonts for substitution.
> >
> >> The matrix swapping is also strange. In many case your work around would
> >> be fine, but in others when the matrix was explicitly set it would be
> >> wrong. Here it would be nice to know which case are handled correct and
> >> which wrong by the current code. Is there anything special in the way
> >> you created you font?
> >
> > The font I use is pretty much the standard font you can get (see above
> > link).
> > While I don't understand font matrix that much,
> > it does not make sense to me that you can apply a matrix of English font
> > to Chinese font, not to mention other languages, like Indian or Arabic
> > font.
> > So sharing font matrix across fonts of different languages looks
> > more wrong to me.
> > And if users set matrix explicitly to the default font,
> > it means he want to change matrix of default font, not any other.
> > Automatically applying such matrix to any other fonts also seems wrong to
> > me.
> >
> > Regards
> >
> > Yen-Ju
> >
> >> Cheers,
> >> Fred
> >>
> >> Yen-Ju Chen wrote:
> >>> O.K. Sorry for another reply
> >>> This patch fixes the upside-down problem.
> >>> The attached screenshot uses English font as default font
> >>> and Chinese font as substitute.
> >>> I probably need to find a Japanese font and a symbol font to test
> >>> multiple substitute.
> >>> By the way, the speed is not bad.
> >>> Previously I said that it takes 1-2 seconds for 25,000+ Chinese glyphs
> >>> is including putting all glyphs on a NSMatrix.
> >>> So it is fast to get the coverage in NSFont.
> >>>
> >>> Yen-Ju
> >>>
> >>> On 8/10/07, Yen-Ju Chen <[EMAIL PROTECTED]> wrote:
> >>>> Another issue is that sometimes freetype fails to get the coverage.
> >>>> Therefore, NSCharacterSet raise an exception:
> >>>> "Specified range exceeds character set".
> >>>> So this patch prevents NSAttributedString from using all available fonts
> >>>> to eliminate the possibility of using bad fonts.
> >>>> It only uses user specified fonts for substitution.
> >>>> And I hope GNUstep can add an user default to specify the preferred
> >>>> fonts.
> >>>>
> >>>> Once the patch is applied, the font substitute basically works, but
> >>>> has one problem.
> >>>> I attach a screenshot to explain that.
> >>>> The left window is using English font as default font and no preferred
> >>>> font.
> >>>> So you only see English 'GNUstep'.
> >>>> The middle window is using Chinese font as default font and no preferred
> >>>> font.
> >>>> Because Chinese font also contains English letter,
> >>>> you see both English and Chinese.
> >>>> You can tell the English letter is from different font.
> >>>> The right window is using English font as default font and Chinese
> >>>> font as substitute.
> >>>> Again, you can see both English and Chinese character.
> >>>> But the funny thing is the Chinese character is upside-down.
> >>>> I have no idea why it happens, but I suspect gui or back cache the font
> >>>> matrix
> >>>> so the matrix of English font is applied to the Chinese font.
> >>>> The hint of Chinese font is also different between middle and right
> >>>> window.
> >>>> The middle one is sharp while the right one is blur.
> >>>> It indicates something is cached, probably for the English font at the
> >>>> start of the text.
> >>>> Maybe someone has insights about what may cause it.
> >>>>
> >>>> Yen-Ju
> >>>>
> >>>> On 8/10/07, Yen-Ju Chen <[EMAIL PROTECTED]> wrote:
> >>>>> Hi,
> >>>>>
> >>>>> [NSFont coveredCharacterSet] is broken.
> >>>>> I attach a patch.
> >>>>> A quick test shows that a Chinese font which contains 25,000+ glyph
> >>>>> takes only about 1-2 seconds to go through.
> >>>>> It's on a powerbook G4 1GHz.
> >>>>> So cache may not be needed for coveredCharacterSet.
> >>>>> I haven't test the preferredFont yet.
> >>>>> Hope this patch can go in soon.
> >>>>>
> >>>>> Yen-Ju
> >>>>>
> >>>>> On 8/9/07, Yen-Ju Chen <[EMAIL PROTECTED]> wrote:
> >>>>>> On 8/9/07, Fred Kiefer <[EMAIL PROTECTED]> wrote:
> >>>>>>> Yen-Ju Chen wrote:
> >>>>>>>> On 8/8/07, Fred Kiefer <[EMAIL PROTECTED]> wrote:
> >>>>>>>>> Yen-Ju Chen wrote:
> >>>>>>>>>> Another thing I am thinking is to save the coveredCharacterSet
> >>>>>>>>>> on disk.
> >>>>>>>>>> Font does not change frequently,
> >>>>>>>>>> and it does take time to generate coveredCharacterSet for each
> >>>>>>>>>> font,
> >>>>>>>>>> especially for CJK.
> >>>>>>>>>> If the cached coveredCharacterSet can be saved on disk and
> >>>>>>>>>> loaded later,
> >>>>>>>>>> it can reduce the overhead of starting an application.
> >>>>>>>>>> For art backend, it can even pack the saved coveredCharacterSet
> >>>>>>>>>> in nfont.
> >>>>>>>>>> So for small font, it is fine to check the covered character
> >>>>>>>>>> each time.
> >>>>>>>>>> For big font, saved character set is better.
> >>>>>>>>>>
> >>>>>>>>> Great idea! Would you like to work on that?
> >>>>>>>> If the patch you have goes into the -trunk,
> >>>>>>>> I can play with it and see how much it effects the speed
> >>>>>>>> and decide what's the best way to do the cache if needed.
> >>>>>>>>
> >>>>>>> I just committed this change, now it is your turn :-)
> >>>>>> Thanx. I will take a look shortly.
> >>>>>>
> >>>>>> Yen-Ju
> >>>>>>
> >>>>
> >>>> ------------------------------------------------------------------------
> >>>>
> >>>> Index: NSAttributedString.m
> >>>> ===================================================================
> >>>> --- NSAttributedString.m (revision 25384)
> >>>> +++ NSAttributedString.m (working copy)
> >>>> @@ -990,7 +990,7 @@
> >>>> - (NSFont*)_substituteFontWithName: (NSString*)fontName font:
> >>>> (NSFont*)baseFont
> >>>> {
> >>>> // FIXME: Catch case were baseFont is nil
> >>>> - return [NSFont fontWithName: fontName matrix: [baseFont matrix]];
> >>>> + return [NSFont fontWithName: fontName size: [baseFont pointSize]];
> >>>> }
> >>>>
> >>>> - (NSFont*)_substituteFontFor: (unichar)uchar font: (NSFont*)baseFont
> >>>> fromList: (NSArray *)fonts
> >>>> @@ -1061,13 +1061,6 @@
> >>>> {
> >>>> return subFont;
> >>>> }
> >>>> -
> >>>> - subFont = [self _substituteFontFor: uchar font: baseFont fromList:
> >>>> - [[NSFontManager sharedFontManager]
> >>>> availableFonts]];
> >>>> - if (subFont != nil)
> >>>> - {
> >>>> - return subFont;
> >>>> - }
> >>>>
> >>>> return nil;
> >>>> }
> >>>>
> >>>> ------------------------------------------------------------------------
> >>>>
> >>
> >
>
>
GNUstep ä»ç´¹
ç°¡å®ä¾èªª, GNUstep æ¯å¯¦ä½ OpenStep ä»é¢çéæ¾è»é« (Open Source)
è¨å, ç®æ¨çºæä¾è·¨å¹³å°çç©ä»¶å°åç¨å¼éç¼ç°å¢.
æ©å¨ 1985 å¹´, Steve Jobs é¢éèæé»è
¦ (Apple) 徿ç«äº NeXT
å
¬å¸, ä¸¦æ¼ 1988 å¹´æ¨åºäº NeXT é»è
¦, ä½¿ç¨ NeXTStep çºä½æ¥ç³»çµ±.
å¨ç¶æ, NeXTStep æ¯ç¸ç¶å
é²ç系統. 以 Unix (BSD) çºåºç¤, 使ç¨
PostScript æä¾é«å質ç使ç¨è
åå½¢ä»é¢, 並以 Objective-C
èªè¨æä¾å®æ´çç©ä»¶å°åç°å¢.
å管 NeXT å¨è»é«ä¸çåªç°, å
¶ç¡¬é«é·å®æç¸¾ä¸ä½³, ä¸ä¹
ä¹å¾,
NeXT 便è½åçºè»é«å
¬å¸. 1994 å¹´, NeXT èæé½ (Sun Microsystem)
å使¨åº OpenStep ä»é¢,
ç®æ¨çºè·¨å¹³å°çç©ä»¶å°åç¨å¼éç¼ç°å¢. NeXT æ¥èæ¨åºå¯¦ä½
OpenStep ä»é¢ç OPENSTEP 系統, å¯å¨ Mach, Microsoft Windows NT, Sun
Solaris å HP/UX ä¸å·è¡. 1996 å¹´, èæé»è
¦è²·ä¸ NeXT,
åçºèæé»è
¦ä¸ä¸ä»£ä½æ¥ç³»çµ±çåºç¤, OPENSTEP
系統便æ¼é²æçº MacOS X ç Cocoa ç°å¢.
å¨ 1995 å¹´, èªç±è»é«åºéæ (Free Software Fundation) éå§äº GNUstep
è¨å, ç®çå¨å¯¦ä½ OpenStep ä»é¢, 以æä¾ Linux/BSD
系統ä¸å宿´çç¨å¼ç¼å±ç°å¢. ä½ç±æ¼ OpenStep ä»é¢éæ¼é¾å¤§,
éç¼äººåä¸è¶³, åè¨±å¤æè¡å¨ç¶æå°æªæç (å¦ Display
PostScript), æä»¥ç´å°ç®åçºæ¢, GNUstep
æç®æ¯ä¸å宿´çç¨å¼éç¼ç°å¢.
å管 OpenStep æ©å¨ 1994 年便æåº,
å
¶ä»é¢åæ¶æ§å¨ç¾ä»ä»ç¸ç¶å
é²å實ç¨, 使å¾éç¼ GNUstep
ç¨å¼ç¸ç¶å®¹æ.
GNUstep ä½¿ç¨ Objective-C èªè¨, æ¯ C èªè¨å ä¸ SmallTalk
çç©ä»¶å°åçåè½. çµåå
©è
çåªé», åä¸è³æ¼å C++
妿¤è¤é.
GNUstep æä¾å
©å主è¦çç¨å¼åº«, Foundation å AppKit. Foundation
èçéåå½¢ä»é¢çé¨ä»½, å¦å串, æªæ¡, 網路, åºæ¬è³æçµæ§,
å¤è¡ç·ç, å稱ä¹çº GNUstep Base. AppKit åèçåå½¢ä»é¢çé¨ä»½,
å
å«è¦çª, 使ç¨è
ä»é¢ç, å稱ä¹çº GNUstep GUI.
ç±æ¼ GNUstep å
·æè·¨å¹³å°çç¹æ§, æé繪ååååçé¨ä»½,
åäº¤ç± GNUstep Back ä¾èç. 使ç¨è
å¯ä¾æä½¿ç¨ç使¥ç³»çµ±,
鏿é©ç¶çå¾ç«¯èç (Backend). GNUstep GUI æèªè¡èçè Back
ç¸éçåè½, ç¨å¼éç¼è
åªè¦ä½¿ç¨ GUI ç¨å¼åº«,
便å¯é©ç¨æ¼å種å¾ç«¯ä¸, å®å
¨ä¸ç¨èæ
®å¹³å°åé¡.
ç®å GNU GCC 3.x æ¯æ´ Objective-C èªè¨, GNUstep åæä¾ GNUstep Make
ä¾ç°¡åç·¨è¯ Objective-C ç¨å¼. GNUstep Make æä¾é¡ä¼¼ Makefile
çåè½, ç¨±çº GNUmakefile. è Makefile ç¸æ¯è¼ä¹ä¸ GNUmakefile
ç°¡å®è¨±å¤.
ç¶åä¸è¿°, GNUstep å¯¦ä½ OpenStep ä»é¢,
該ä»é¢å·²å¨åæ¥å¸å ´ä¸ä½¿ç¨å¤å¹´, ç®å並æ¼é²æ MacOS X ç
Cocoa ç°å¢. GNUstep å
å«åå主è¦é¨ä»½, çµ±ç¨±çºæ ¸å¿ (Core):
1. GNUstep Make: æä¾é¡ä¼¼ Makefile çåè½, 稱çº
GNUmakefile, è¼ Makefile 好ç¨è¨±å¤.
2. GNUstep Base: æä¾ OpenStep ç Foundation ç¨å¼åº«,
èçéåå½¢ä»é¢çåè½.
3. GNUstep GUI: æä¾ OpenStep ç AppKit ç¨å¼åº«,
èçåå½¢ä»é¢çåè½.
4. GNUstep Back: æä¾è使¥ç³»çµ±ç¸éçå¾ç«¯èç,
æä¾ GNUstep GUI æé繪ååååçåè½.
===============
Ãtoilé
(§) (â±) (â¬) (â) (â) (âµ) (â¥)_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep