Re: A Tab after 4 SPACEs

2008-03-28 Thread Uli Kusterer
On 28.03.2008, at 10:16, Gerriet M. Denkmann wrote: The documentation says: "Returns the named encoded glyph, or –1 if the receiver contains no such glyph." Returning a negative number seems to be kind of difficult as NSGlyph is defined as unsigned int. Tests with "sp8 f8 s83 3ace" (assumed to

Re: A Tab after 4 SPACEs

2008-03-28 Thread Gerriet M. Denkmann
On 28 Mar 2008, at 00:53, Alastair Houghton wrote: On 27 Mar 2008, at 16:12, Gerriet M. Denkmann wrote: Current I am using: NSString *dummyString = [ NSString stringWithUTF8String: " " ]; NSTextView *dummyTextView = [ [ NSTextView alloc ] initWithFrame: NSMakeRect(0,0,1e4,1e4) ]; [

Re: A Tab after 4 SPACEs

2008-03-27 Thread Alastair Houghton
On 27 Mar 2008, at 16:12, Gerriet M. Denkmann wrote: Current I am using: NSString *dummyString = [ NSString stringWithUTF8String: " " ]; NSTextView *dummyTextView = [ [ NSTextView alloc ] initWithFrame: NSMakeRect(0,0,1e4,1e4) ]; [ dummyTextView setString: dummyString ]; [ dummyTextVi

Re: A Tab after 4 SPACEs

2008-03-27 Thread glenn andreas
On Mar 27, 2008, at 11:12 AM, Gerriet M. Denkmann wrote: On 27 Mar 2008, at 10:08, Uli Kusterer wrote: On 27.03.2008, at 09:32, Gerriet M. Denkmann wrote: float widthOfTab = [usedFont advancementForGlyph:(NSGlyph)' '].width * 4; I'm pretty new to the text engine myself, but I don't think

Re: A Tab after 4 SPACEs

2008-03-27 Thread Gerriet M. Denkmann
On 27 Mar 2008, at 10:08, Uli Kusterer wrote: On 27.03.2008, at 09:32, Gerriet M. Denkmann wrote: float widthOfTab = [usedFont advancementForGlyph:(NSGlyph)' '].width * 4; I'm pretty new to the text engine myself, but I don't think an NSGlyph can be generated by typecasting a char. Since

Re: A Tab after 4 SPACEs

2008-03-27 Thread Uli Kusterer
On 27.03.2008, at 10:08, Uli Kusterer wrote: But the glyph with number 0x20 is probably a completely different width than the glyph corresponding to a space in other languages. I meant in other *fonts*, not languages. Cheers, -- Uli Kusterer "The Witnesses of TeachText are everywhere..." htt

Re: A Tab after 4 SPACEs

2008-03-27 Thread Uli Kusterer
On 27.03.2008, at 09:32, Gerriet M. Denkmann wrote: float widthOfTab = [usedFont advancementForGlyph:(NSGlyph)' '].width * 4; I'm pretty new to the text engine myself, but I don't think an NSGlyph can be generated by typecasting a char. Since Monaco or Courier are monospaced, it just so