Re: NSTextContainer exclusionPaths not working on iOS without UITextView

2017-09-21 Thread Aki Inoue
Steve, You should be rendering using NSLayoutManager instead of -drawInRect:. The method is handling NSTextStorage just as a mere NSAttributedString ignoring the rest of objects connected. Check out the documentation for -[NSLayoutManager drawGlyphsInGlyphRange:atPoint:]. Aki > On Sep 21, 20

Re: Normalisation of filenames

2017-04-02 Thread Aki Inoue
> On Apr 2, 2017, at 1:50 AM, Gerriet M. Denkmann wrote: > >> >> On 2 Apr 2017, at 10:59, Aki Inoue wrote: >> >> >>> On Apr 1, 2017, at 4:57 PM, Gerriet M. Denkmann wrote: >>> >>> >>>> On 2 Apr 2017, at 06:33, Jens A

Re: Normalisation of filenames

2017-04-01 Thread Aki Inoue
> On Apr 1, 2017, at 4:57 PM, Gerriet M. Denkmann wrote: > > >> On 2 Apr 2017, at 06:33, Jens Alfke wrote: >> >> >>> On Apr 1, 2017, at 11:58 AM, Gerriet M. Denkmann >>> wrote: >>> >>> I think that the examples above show, that NSURL does indeed do something >>> about normalising Unicode

Re: Memory optimization of NSAttributedString

2015-03-23 Thread Aki Inoue
Hi Charles Yes, NSAttributedString does unique attribute dictionaries. Aki > On Mar 22, 2015, at 5:39 AM, Charles Jenkins wrote: > > My app uses lots of attributed strings in “subdocuments” which get moved into > and out of a text edit window. > > I began to wonder if I needed to add a cache

Re: Number of chars

2013-03-21 Thread Aki Inoue
On Mar 21, 2013, at 6:05 PM, Andrew Thompson wrote: > > > On Mar 21, 2013, at 2:10 PM, Aki Inoue wrote: > >> For that matter, UTF-32 (aka UCS-4) is not safe to find the truncation >> boundary just at the 4-byte boundary. > > You're thinking of combining

Re: Number of chars

2013-03-21 Thread Aki Inoue
Please note that std::string does not provide the localized behavior for collation, searching, case mapping, etc that our customers are accustomed to. If you're handling user visible strings, we recommend sticking to NSString at least for those operations. Also, looking for a safe byte boundary

Re: drawGlyphsForGlyphRange layout issue

2012-09-25 Thread Aki Inoue
ases, using NSStringDrawing methods are more efficient. You should sample with your particular app before making the decision. Aki On 2012/09/24, at 12:01, jonat...@mugginsoft.com wrote: > On 24 Sep 2012, at 19:19, Aki Inoue wrote: > >> To be compatible with NSLayoutManager, you s

Re: drawGlyphsForGlyphRange layout issue

2012-09-24 Thread Aki Inoue
To be compatible with NSLayoutManager, you should use -drawWithRect:options:attributes: here instead of using CT. Your source of trouble is using -drawAtPoint: which uses NSStringDrawingUsesLineFragmentOrigin option (layout glyphs from the top instead of the glyph origin). Aki On 2012/09/24,

Re: String Encoding

2012-06-12 Thread Aki Inoue
All the accented chars, for example, are represented differently. Aki Inoue On 2012/06/12, at 14:43, koko wrote: > OK. NSUTF8 it is. I just sent a beta to Norway so I'll know more in the > next 24 hours. > > -koko > > > On Jun 12, 2012, at 3:13 PM, Stephane

Re: String Encoding

2012-06-12 Thread Aki Inoue
When dealing with the file system pathnames, you should use the file system representation methods from NSString/NSFileManager. Specifically, -[NSFileManager fileSystemRepresentationWithPath:] and -[NSFileManager stringWithFileSystemRepresentation:]. Aki On 2012/06/12, at 12:42, koko wrote:

Re: NSTextInputClient Protocol Question

2012-05-29 Thread Aki Inoue
send the moveToLeftEndOfLine: selector. > So the choice of what goes to the menu, and what goes to -doCommandBySelector: > must be more subtle than Command+key and (not Command)+key, or maybe just > plain arbitrary ? > > A+ > > On 26/05/12 00:42, Aki Inoue wrote: >> Becaus

Re: NSTextInputClient Protocol Question

2012-05-25 Thread Aki Inoue
What's happeneing ? > > A+ > > On 22/05/12 04:57, Aki Inoue wrote: >> Hello Eric, >> >>> - (NSUInteger) characterIndexForPoint: (NSPoint) iPoint >>> - (NSRect) firstRectForCharacterRange: (NSRange) iRange actualRange: >>> (NSRangePointer)

Re: NSTextInputClient Protocol Question

2012-05-21 Thread Aki Inoue
Hello Eric, > - (NSUInteger) characterIndexForPoint: (NSPoint) iPoint > - (NSRect) firstRectForCharacterRange: (NSRange) iRange actualRange: > (NSRangePointer) oActualRange > never get called, which I suppose are here for handling mouse events and thus > the selection ? The methods are for the

Re: NSLayoutManager's setDefaultAttachmentScaling: not working in custom PDF NSContexts.

2012-01-30 Thread Aki Inoue
Sounds like a bug. File a bug report. Thanks, Aki On Jan 29, 2012, at 10:03 AM, Gus Mueller wrote: > I have an issue where using NSLayoutManager's > setDefaultAttachmentScaling:NSImageScaleProportionallyDown doesn't seem to > work if I setup my own NSGraphicsContext + CGPDFContext. > > The

Re: How select NSTextField programatically?

2011-12-13 Thread Aki Inoue
The validation functionality is provided by NSFormatter. Aki On 2011/12/13, at 8:10, McLaughlin, Michael P. wrote: > I have a Cocoa "dialog" with several textfields for numerical input. When > the user enters a bad value, I want to select that view programatically along > with an NSBeep() so

Re: Business as usual: Flipped context causing grief

2011-12-12 Thread Aki Inoue
Graham, +[NSGraphicsContext graphicsContextWithBitmapImageRep:] is a cover method of a more general, +[NSGraphicsContext graphicsContextWithGraphicsPort:flipped:]. You can create a CGBitmapContextRef out of the bitmap rep & pass to the latter method. Aki On 2011/12/12, at 17:07, Graham Cox wr

Re: Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField

2011-09-27 Thread Aki Inoue
Eric, We really recommend looking at the approach I described earlier using NSFormatter subclass for input validation. - (BOOL)isPartialStringValid:(NSString **)partialStringPtr proposedSelectedRange:(NSRangePointer)proposedSelRangePtr originalString:(NSString *)origString originalSelectedRang

Re: Equivalent of UITextField's textField:shouldChangeCharactersInRange:replacementString for NSTextField

2011-09-21 Thread Aki Inoue
Actually, the most of functionality provided by the UITextField method is better implemented by a formatter subclass with NSTextField. Aki Inoue On 2011/09/21, at 19:49, Jens Alfke wrote: > > On Sep 21, 2011, at 7:42 PM, Eric Wing wrote: > >> I have been using the de

Re: how to get baseline info

2011-09-12 Thread Aki Inoue
You can iterate through the line fragment positions using -[NSLayoutManager lineFragmentRectForGlyphIndex:effectiveRange:]. >From the line fragment origin, the baseline offset can be determine by using >-[NSTypesetter baselineOffsetInLayoutManager:glyphIndex:]. The typesetter can be obtained vi

Re: Crasher due to unsafe block implementation in -[NSTextView checkTextInRange:types:options:]?

2011-08-03 Thread Aki Inoue
Kyle, It appears you're right. Another approach is to use multiple field editor objects so that you keep the first editor content unmodified. Aki On 2011/08/02, at 18:37, Kyle Sluder wrote: > On Tue, Aug 2, 2011 at 6:09 PM, Aki Inoue wrote: >> Hi Tom, >> >> Defini

Re: Crasher due to unsafe block implementation in -[NSTextView checkTextInRange:types:options:]?

2011-08-02 Thread Aki Inoue
Hi Tom, Definitely write a Radar. One thing you could try is overriding both -checkTextInRange:types:options: & -handleTextCheckingResults:forRange:types:options:orthography:wordCount: for your field editor. You can have some kind of the field editor session ID. Every time a new field editor

Re: Receiving Unicode Input in NSView

2011-07-29 Thread Aki Inoue
Bill, > we used to call interpretKeyEvents in the keyDown handler and the InsertText > handler would get the unicode string, I guess this stopped working with a > system update a while back. We have always required the first responder to adopt either NSTextInput or NSTextInputClient for handling

Re: Receiving unicode keyboard input

2011-07-27 Thread Aki Inoue
coaEventTextInput with "g" and then NO key up event > On FireFox, typing "option-e" and then "e" will generate (1) key down event, > (2) a NPCocoaEventTextInput event with "accented e" and then NO key up event > > > > >

Re: Receiving unicode keyboard input

2011-07-26 Thread Aki Inoue
Bill, You cannot directly access the Cocoa text handling method inside the NPAPI plugins. Instead the NPAPI's Cocoa extension defines the composition handling logic by itself. Refer to the 'Text Input' section in this document . Aki On 2011/07

Re: Linearly Scaling Text

2011-05-25 Thread Aki Inoue
Also, you should disable screen font substitution via -[NSLayoutManager setUsesScreenFont:NO]. This is the main source of glyph advancement differences you're seeing. Aki On 2011/05/25, at 14:41, Douglas Davidson wrote: > > On May 25, 2011, at 2:37 PM, Ajay Sabhaney wrote: > >> - Instead of

Re: encoding of file names

2011-05-23 Thread Aki Inoue
-[NSString compare:] and its variants can handle the normalization properly. Aki Inoue On 2011/05/23, at 21:41, Howard Siegel wrote: > Look at NSString's decomposedStringWithCanonicalMapping and > decomposedStringWithCompatibilityMapping methods. They'll map > Unicode st

Re: Drawing FULL NSAttributedString

2011-04-27 Thread Aki Inoue
Rimas, Typically the text layout system including the Cocoa Text System works in the typographic metrics that's based on the information embedded in the font. So, most layout information returned by NSLayoutManager is in the typographic metrics if not documented otherwise. The information you

Re: How can I make a palette input method with cocoa?

2011-03-28 Thread Aki Inoue
The HIToolbax release note has a section describing the input source types. http://developer.apple.com/library/mac/#releasenotes/Carbon/HIToolbox.html Look for "Text Input Sources". Aki On 2011/03/25, at 0:08, 李顺年 wrote: > Hi All! > > I want to make a palette input method of mac. But the samp

Re: Font Height and -[NSString sizeWithAttributes:]

2011-03-28 Thread Aki Inoue
The default line height used by the Cocoa Text System is based on various layout time configurations. So, the differences you're seeing is coming from the differences in layout context. The settings are all encapsulated in NSLayoutManager; hence, the method -[NSLayoutManager defaultLineHeightF

Re: Weird NSSearchField text layout bug

2011-03-28 Thread Aki Inoue
Looks like an issue with us. Please file a bug with the reproducing steps. Thanks, Aki On 2011/03/25, at 21:50, Indragie Karunaratne wrote: > I'm having a really weird issue with NSSearchField at the moment. Whenever > the search field ends editing, this happens: > > http://d.indragie.com/bR

Re: NSUnicodeStringEncoding

2011-02-14 Thread Aki Inoue
If the data is in-process UTF16 (i.e. host-endian UTF-16 without BOM), you should be using -initWithCharacters:length: instead. Aki On 2011/02/13, at 15:50, Kyle Sluder wrote: > On Sun, Feb 13, 2011 at 3:17 PM, Todd Heberlein > wrote: >> [[NSString alloc] initWithBytes:byte_stream length:len

Re: Bizarre behaviour of NSFontDescriptor and/or NSCharacterSet

2011-02-01 Thread Aki Inoue
I would recommend using the 3rd method. The first approach is instantiating an NSFont instance for all available faces. Instantiating NSFont has additional costs over just querying font descriptors (the font instance references graphics attributes, for example). The resource should be deallocated

Re: text orientation/positioning with layout manager

2011-02-01 Thread Aki Inoue
t matrix in the flipped coordinate system. So, the automatic text matrix inversion is for rendering correctly in the flipped coordinate, not for non-flipped coordinate. Aki On 2011/02/01, at 14:14, David F. wrote: > > On Feb 1, 2011, at 1:38 PM, Aki Inoue wrote: > >> What the T

Re: text orientation/positioning with layout manager

2011-02-01 Thread Aki Inoue
ipped CTM automatically (inside -[NSFont setInContext:]) so that the text is rendered correctly regardless of the rendering context flippedness. Aki On 2011/01/31, at 18:04, Todd Heberlein wrote: > On Jan 31, 2011, at 3:23 PM, Aki Inoue wrote: > >> The precise definition of the p

Re: Bizarre behaviour of NSFontDescriptor and/or NSCharacterSet

2011-02-01 Thread Aki Inoue
Brian, The font descriptor here describes a query matching font descriptors containing the character set equals to the supplied set. Since it's unlikely to have fonts with just "0123456789", for example, it should return 0 result. If you're seeing something different, please file a bug. To wha

Re: text orientation/positioning with layout manager

2011-01-31 Thread Aki Inoue
The precise definition of the point specified by the argument is the top left corner of the text container containing the glyph range in the focused view coordinate system. Aki On Jan 31, 2011, at 3:18 PM, Graham Cox wrote: > > On 01/02/2011, at 9:09 AM, Todd Heberlein wrote: > >> I'm doing

Re: Rendering combining marks

2011-01-03 Thread Aki Inoue
-drawInRect: variant is designed for matching the field editor layout. -drawWithRect: variant is the base and should be used over the other two. Aki Inoue On 2011/01/03, at 16:45, George Nachman wrote: > On Mon, Jan 3, 2011 at 1:47 PM, Wim Lewis wrote: >> >> On 2 Jan 2

Re: Performance: Drawing hundreds of short text strings

2010-12-21 Thread Aki Inoue
Yes, we optimized NSStringDrawing API since the documentation discouraging its use was first written. In fact, for some of short simple string rendering, it's the fastest on the platform (use -drawWithRect:... variants for the maximum efficiency if possible). So, as already mentioned, use the

Re: NSSecureTextFieldCell detected a field editor ((null))

2010-11-11 Thread Aki Inoue
Somehow NSSecureTextFieldCell is receiving a nil field editor in -selectWithFrame:... or -editWithFrame:. Aki On 2010/11/10, at 10:21, FF wrote: > A NSSecureTextField works fine, but the msg. in the Console after entering > password says: > NSSecureTextFieldCell detected a field editor ((null)

Re: Any way to get NSTextFieldCell to wrap AND truncate?

2010-11-01 Thread Aki Inoue
-[NSCell setTruncatesLastVisibleLine:YES] should do the trick. Aki On 2010/11/01, at 14:52, Ben Lachman wrote: > I have a cell that I'd like to wrap its text. However there's the > possibility of even after wrapping there being too much text to display. Is > there a way to get truncation to

Re: AM/PM letter UNICODE issues

2010-10-18 Thread Aki Inoue
Alex, Uli is giving very helpful recommendations here. The leave-the-first-character logic doesn't work for Korean and Japanese, either. They happen to spell AM/PM like MA/MP as Quincey warned. If you have specific target locales in mind, I recommend providing a set of formatting configuratio

Re: Not understanding NSString's compare:options:range:locale: method

2010-10-08 Thread Aki Inoue
Hi Derek, The range argument only applies to the receiver of the message. So, with your first example, you're comparing @"a" against @"ac". Aki On 2010/10/05, at 2:48, Derek Huby wrote: > This method isn't doing what I expect it to do (which probably means that I'm > expecting the wrong thing.

Re: CGContextSelectFont spinlock

2010-09-15 Thread Aki Inoue
Since I didn't see the actual backtrace, I cannot comment on what could be causing a spin lock deadlock. One glaring point I'm concerned with this example is that the font name being passed to CGContextSelectFont is incorrect. All of our font APIs, both on Mac OS X and iOS, are expecting the po

Re: Viewing a single NSTextStorage with two sets of attributes

2010-09-13 Thread Aki Inoue
Andrew, I usually recommend subclassing NSTextStorage returning different attributes based on a property/flag. The tricky part is (as you might already encountered) to make sure setting up the property at the right moment. In normal operations, the Text System queries the attributes roughly in

Re: NSGlyphGenerator behavior

2010-08-09 Thread Aki Inoue
On 2010/08/07, at 22:08, vincent habchi wrote: > Aki, > >> No, it doesn't chunk based on word boundary. >> It could callback in chunks in order to prevent allocating too large buffer, >> though. >> >> So, you should be prepare to insert whatever requested. > > In fact, you're (of course) r

Re: NSGlyphGenerator behavior

2010-08-07 Thread Aki Inoue
No, it doesn't chunk based on word boundary. It could callback in chunks in order to prevent allocating too large buffer, though. So, you should be prepare to insert whatever requested. Aki From iPhone On 2010/08/07, at 9:14, vincent habchi wrote: > Hi there, > > There is little documen

Re: NSTextView becomes temporarily unresponsive

2010-07-13 Thread Aki Inoue
This is indeed an issue with the text system (trying to pre-heat the inserted text range for various text checking tasks). Please file a bug. > 4. As a workaround, could you use underscore characters instead of hyphens? I > tried using en dash and got the same result as hyphens. > > 5. May I su

Re: NSTextView editing top-down and right to left.

2010-07-02 Thread Aki Inoue
Hello Abhinay, > I was wondering if its possible to use NSTextView for top-down editing. I > could not find a method to set it to top down. NSTextView currently does not support the vertical text editing. > this results in a split caret with top half caret at extreme left and bottom > half at e

Re: using UTF-32 in NSString.

2010-06-28 Thread Aki Inoue
CFStringGetSurrogatePairForLongCharacter is an inline function. You can just copy the definition to your project (with warning once your baseline become SL and later). Aki On Jun 28, 2010, at 3:17 PM, Georg Seifert wrote: > >> You can do something like this: >> UniChar characters[2]; >> CFI

Re: using UTF-32 in NSString.

2010-06-27 Thread Aki Inoue
Georg, NSString/CFString is conceptually an object wrapping around UTF-16 character array (just like many other string objects). The length 2 returned from your example is, thus, the expected behavior. When you're creating a string with Universal Character Names that containing non-BMP points

Re: conflict between Core Graphics and NSView graphics

2010-04-26 Thread Aki Inoue
hard to keep these inconsistencies hidden from the apps 8-). Aki On Apr 26, 2010, at 1:29 PM, Jens Alfke wrote: > > On Apr 26, 2010, at 12:50 PM, Aki Inoue wrote: > >> In CG, there are 3 font properties that determine the font rendering: font >> name, font size, and t

Re: conflict between Core Graphics and NSView graphics

2010-04-26 Thread Aki Inoue
coa > > i see the text in the right spot but the size is gigantic > > > > thanks, > > bill > > > > > > On Mon, Apr 26, 2010 at 12:34 PM, Aki Inoue wrote: > Bill, > > How are you rendering the text ? > > We recommend stic

Re: conflict between Core Graphics and NSView graphics

2010-04-26 Thread Aki Inoue
Bill, How are you rendering the text ? We recommend sticking to Cocoa text rendering API in order to support proper Unicode rendering. Thanks, Aki On Apr 26, 2010, at 12:24 PM, Bill Appleton wrote: > hi all > > i converted a bunch of quickdraw code to core graphics successfully -- it > work

Re: where is the basic NSString literal escape documentation?

2010-04-19 Thread Aki Inoue
\u and \U formats (or universal character names ) are part of C99 standard. Aki On Apr 19, 2010, at 6:11 PM, Matt Neuburg wrote: > > On Apr 19, 2010, at 6:02 PM, Kyle Sluder wrote: > >> On Mon, Apr 19, 2010 at 5:44 PM, Matt Neuburg wrote: >>> Supposing you were a complete C / Obj

Re: Cocoa text via Quartz CGLayer

2010-02-06 Thread Aki Inoue
It's the screen font setting that's causing the shift between the two. When you use the screen font, CoreGraphics tries to position the glyph origin at the pixel boundary as much as possible. In this case, because of the way two rendering types differ how interpret the pixel boundary, the shift

Re: NSATSGlyphStorage memory usage.

2010-01-05 Thread Aki Inoue
It's supposed to be managed automatically. If you see suspicious behavior, please file a bug with reproducing steps if possible. Thanks, Aki On 2010/01/05, at 15:03, jonat...@mugginsoft.com wrote: > My app repeatedly loads and unloads a couple of MB of text into an NSTextView. > Running heap(

Re: Weird problem with Core Text

2009-11-12 Thread Aki Inoue
> Your comments do make sense. But the glitch lies in the code where it tries > to format a chunk of text with CTFrameSetter. I doubt it might have been > trapped into some infinite loop of memory allocation in the implementation > of > CTFrameSetterCreateFrame, and that's the reason why it's

Re: Weird problem with Core Text

2009-11-11 Thread Aki Inoue
would succeedl, right? > > > DairyKnight > > On Thu, Nov 12, 2009 at 2:20 AM, Aki Inoue wrote: > Hi, > > CoreText is designed to be a core line layout engine, a building block for > full-fledged text systems like the Cocoa Text System or WebKit. > > So, i

Re: -[NSString stringWithCString:encoding:] memory management question

2009-11-11 Thread Aki Inoue
Another possibility. Since you're asking to instantiate the string with NSASCIIStringEncoding, the method could return nil when it fails to convert the pBuffer contents (i.e. non-ASCII bytes above 0x7F). That would lead to trigger exception raises at the line immediately following. That might

Re: Weird problem with Core Text

2009-11-11 Thread Aki Inoue
Hi, CoreText is designed to be a core line layout engine, a building block for full-fledged text systems like the Cocoa Text System or WebKit. So, it's not meant for this kind of full document processing. It's hitting the 4GB memory barrier. I can reproduce the same issue on SL running in 32b

Re: boundingRectWithSize:Option: and height constraint

2009-11-11 Thread Aki Inoue
The request is reasonable. Please file a bug. Thanks, Aki On 2009/11/11, at 5:53, Bill Cheeseman wrote: > Over the past 5 years, according to Google, many people have asked why > -[NSAttributedString boundingRectWithSize:options] does not honor the > proposed height constraint, but nobody ha

Re: NSLayoutManager and best override point for temporary attributes

2009-10-02 Thread Aki Inoue
the colour, so this should be fine. (Although I'm not sure how I would use this method if I wanted, say, the underline to be a different colour from the text, which I need for certain link attributes.) Many thanks again and all the best, Keith --- On Fri, 10/2/09, Aki Inoue wrote:

Re: NSLayoutManager and best override point for temporary attributes

2009-10-02 Thread Aki Inoue
Keith, If your custom attributes modifies just the graphics state (don't affect the layout), you can override -[NSLayoutManager showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment :]. The method is the bottleneck for calling CG APIs. You can query the text attribute

Re: Displaying characters from the 'Unicode Symbols' font ??

2009-09-25 Thread Aki Inoue
The Unicode values beyond 16bit range are represented with a pair of UTF-16 characters in U+D800 ~ U+DFFF. See relevant items in for the definitions. There are several ways to insert UTF-32 values into NSString. Doug mentioned some. The easiest is to use th

Re: Handling international text without text views

2009-08-31 Thread Aki Inoue
The bottom-line window approach was mainly for supporting Carbon applications that cannot be moved from the WNE design model due to its own legacy application structuring. Since Cocoa is not based on responder message handling design, such event handling model is unnecessary. And the user

Re: NSDateFormatter issue (bug maybe)?

2009-07-20 Thread Aki Inoue
When you're generating/parsing a date format that's supposed to be stable like this, you should control the locale/calendar used by the formatter instead of letting the user settings control it. For example, your data can be entirely off when the user's calendar is not Gregorian. Instead,

Re: Crashes in Framework? Tracking down ghosts.

2009-07-13 Thread Aki Inoue
NSFont *font = [NSFont fontWithName:@"Lucida Grande" size:fontSize]; One thing to note here. "Lucida Grande" is not a valid font name. The valid name for the font is "LucidaGrande" without the space. The font system does return the font you intended (matching against the familyname), but it's

Re: [Q] CFStringGetCStringPtr( ..., kCFStringEncodingUTF8)

2009-06-23 Thread Aki Inoue
JongAm, The keyword here is that the function returns non-NULL when it can do so "efficiently". It all depends on a particular CFString instance's internal representation and the encoding being passed. The best encoding for a particular string is CFStringGetFastestEncoding (). Aki On Ju

Re: Wacky Text View Glyph Rending Bug

2009-05-27 Thread Aki Inoue
Looks like the glyph info stored in NSLayoutManager is out of sync. Are you calling -edited:range:changeInLength: from your implementation of attribute modifying methods ? Aki On 2009/05/27, at 18:19, Seth Willits wrote: http://www.sethwillits.com/temp/TextViewGlyphBug.mov I have a custo

Re: parsing a string into words

2009-04-25 Thread Aki Inoue
In AppKit land, -[NSAttributedString doubleClickAtIndex:] would help you. Aki from iPhone On 2009/04/25, at 2:15, "Gerriet M. Denkmann" wrote: On 25 Apr 2009, at 09:21, Michael Ash wrote: On Fri, Apr 24, 2009 at 9:24 PM, Gerriet M. Denkmann wrote: I want to parse a string into wo

Re: NSProgressIndicator's setUsesThreadedAnimation only works sometimes?

2009-03-13 Thread Aki Inoue
Sean, AppKit is using -[NSApplication updateWindows] for some of animation thread synchronization tasks. If you experience animation not properly starting up with blocking operations, you can kick start the animation by calling the method before going into the operation. Aki Rob, Thank

Re: Line spacing in NSTextView

2009-02-14 Thread Aki Inoue
On Sat, Feb 14, 2009 at 9:58 PM, Aki Inoue wrote: The Text System encapsulates the logic to determine the ideal layout. It's not just queried from a font instance. It requires the context of an entire line. What if the line is rendered with a single font? Which font attribute

Re: Line spacing in NSTextView

2009-02-14 Thread Aki Inoue
Slava, Calculating an optimal vertical layout is pretty involved. At least, the Cocoa Text System has sophisticated logic to determine the ideal layout because of the numerous and varying design target for different fonts. For example, as you found out, many fonts designed in 80s have pr

Re: string bounding rect methods

2009-01-16 Thread Aki Inoue
Yes, rendering and measuring methods behave the same. Please file a doc enhancement request. Thanks, Aki On 2009/01/16, at 19:11, James Walker wrote: The documentation for -[NSString boundingRectWithSize:options:attributes:] simply describes the size parameter as "the size of the rectangl

Re: Find with Nonspacing_Mark

2008-12-29 Thread Aki Inoue
Actually Thai vowels are not considered a diacritics and, thus, not ignored by the flag. Also, note that, even though it is true we sometimes take advantage of ICU from our frameworks, it is an implementation detail and should not be considered always true. In this particular case, we're

Re: Find with Nonspacing_Mark

2008-12-29 Thread Aki Inoue
The standard operation here is to always match characters at the grapheme cluster boundaries. Since SARA U is a non-spacing mark, we don't allow partial matching. Trying to cause partial matching, even for Thai/Indic/Hebrew/Arabic scripts that some of non-spacing marks are vowels, is cosider

Re: Key-bindings Dictionary Location

2008-12-15 Thread Aki Inoue
The documentation is describing the location of key binding dictionary the AppKit framework is using. It's totally legal for an app to have its own key binding system (just like Xcode does) and store the default dictionary somewhere else. Aki On 2008/12/12, at 23:12, Dong Feng wrote: See

Re: Controlled Font Substitution

2008-12-03 Thread Aki Inoue
Mac OS X ships with Thonburi as the Thai system font, and that's the font usually you get for Thai character substitution. The font substitution system is applying sophisticated algorithm to closely match font traits, and it appears it's causing the random fallback. Probably the system shou

Re: Button title irregularities

2008-12-02 Thread Aki Inoue
You're using Helveitca 12.0 as your label font. Use [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize: [yourButton controlSize]]] instead. Aki On 2008/12/02, at 13:39, Randall Meadows wrote: I am porting an iPhone app to the Mac, and the client desires the exact same look-and-f

Re: NSTypesetter problem

2008-11-25 Thread Aki Inoue
etter gets initialized only when i try to edit the text, and then it goes in to an infinite loop On 25-Nov-08, at 12:35 AM, Aki Inoue wrote: NSATSTypesetter trying to create a new instance is a normal behavior. When the typesetter detects it's being invoked to layout recursively, it inst

Re: Determining use of serial comma

2008-11-24 Thread Aki Inoue
I believe the serial comma is, in a strict sense, not tied to any particular locale even though it's commonly used in US. Also, it's advisable not to try algorithmically formatting localized strings like this. It often causes issues with other locales because it's very hard for a single per

Re: NSTypesetter problem

2008-11-24 Thread Aki Inoue
NSATSTypesetter trying to create a new instance is a normal behavior. When the typesetter detects it's being invoked to layout recursively, it instantiates a copy. The real culprit here is probably at #15 -[TTypesetter setLineFragmentRect:forGlyphRange:usedRect:baselineOffset:] that's tri

Re: Special Characters... menu item

2008-11-24 Thread Aki Inoue
There is no sure way of preventing it to be added. The menu item and the Character Palette accessed from it is a part of Mac OS X user experience. Why disable ? Aki On 2008/11/22, at 14:51, [EMAIL PROTECTED] wrote: Hi, Is there a way to keep "Special Characters..." from being added to

Re: GetApplicationTextEncoding & "carbon free"

2008-11-21 Thread Aki Inoue
Hi, Mike's comment is right on. The sole purpose of GetApplicationTextEncoding() is to provide functional compatibility with OS 9-era localization resources such as STR#. There really shouldn't be any need to make your app rely on the single script approach even for a modern CFString-based

Re: SOLVED Re: NSAttributedString rendering bugs when rendered with Cocoa Text (rdar://6379047)

2008-11-19 Thread Aki Inoue
Or, you could create an NSView subclass instance with -isFlipped overridden shared among non-flipped views. You can add the flipped view to your view inside -drawRect: and - lockFocus to it temporarily. Depending on your rendering needs, this approach is preferable performance-wise than al

Re: What's wrong with this font thing?

2008-10-30 Thread Aki Inoue
Looks like the typesetter behavior used by these NSStringDrawing methods are affecting the default line height. Please file a bug. Thanks, Aki On 2008/10/30, at 9:19, Randall Meadows wrote: On Oct 30, 2008, at 10:02 AM, Randall Meadows wrote: On Oct 30, 2008, at 9:53 AM, Randall Meadows

Re: What's wrong with this font thing?

2008-10-29 Thread Aki Inoue
The "threshold" being discussed here is the boundary between the screen font vs printer font in NSFont jargon. For font size smaller than 16pt, we automatically substitute the default printer font to its corresponding screen font. The metrics gap is caused by the substitution. You can disab

Re: ASL & Unicode in Xcode's Console

2008-10-29 Thread Aki Inoue
Sean, Thanks for following up to my comment 8-). Yes, we do support non-ASCII characters in CFString/NSString literals with the compiler shipped with Xcode 3.0 and later. The compiler does recognize the CFSTR() macro in non-Objc source files and both the macro and @"" notion in ObjC files.

Re: Problem with NSData to NSString to NSData

2008-10-28 Thread Aki Inoue
Joel, The PDF is a binary data format. So, trying to decode with an ASCII encoding vonverter would result in data loss. I recommend processing it as mere bytes without mapping to a string. Aki from iPhone On 2008/10/28, at 21:43, Joel Norvell <[EMAIL PROTECTED]> wrote: Dear Cocoa-dev Peop

Re: Return and Enter don't "behave" in Text Field (Newb)

2008-10-20 Thread Aki Inoue
You should be able to do it inside control:textView:doCommandBySelector:. Need to return YES to indicate that the text field should not handle the key event. Aki Thanks, John Velman On Mon, Oct 20, 2008 at 12:29:00PM -0700, Aki Inoue wrote: John, "End editing" doesn't necessarily mean losin

Re: Return and Enter don't "behave" in Text Field (Newb)

2008-10-20 Thread Aki Inoue
John, "End editing" doesn't necessarily mean losing focus in terms of behavior visually users can see. In this case, NSTextField does end editing, but calls -selectAll: immediately afterwards to keep the focus. Discussion Field editors interpret Tab, Shift-Tab, and Return (Enter) as cues

Re: NSTokenField: Tokenizing on Right Arrow key

2008-10-16 Thread Aki Inoue
Since the key events are currently handled directly by the text view short-circuiting the normal key binding management (and, thus, - control:textView:doCommandBySelector: delegation), there is no easy way to accomplish this right now. The easiest thing you can do is to write a bug 8-). Aki

Re: NSBezierPath problems, seems to be two bugs

2008-10-15 Thread Aki Inoue
Jochen, The behavioral differences you're observing is the result of NSCompositingOperation setting. NSRectFill() uses NSCompositeCopy whereas NSBezierPath does not modify the current setting that is accessible via -[NSGraphicsContext compositingOperation]. Aki On 2008/10/15, at 4:56,

Re: hyphenationFactor in typesetter and layout manager

2008-10-06 Thread Aki Inoue
Ross, The hyphenation factor can be set for both NSATSTypesetter and NSLayoutManager. My tests indicate that it is sufficient to send setHyphenationFactor: to the typesetter alone (and simpler, if a document has multiple layouts). Is that correct, or must each layout manager's hyphenation

Re: NSCharacterSet :+ (id)newlineCharacterSet

2008-09-08 Thread Aki Inoue
The method was added to 10.5. So, if your project is not targeting 10.5 and later, you get the warning. Aki On 2008/09/08, at 13:57, Filip van der Meeren wrote: Hello, I have the most puzzling question: The documentation of XCode for NSCharacterSet includes the following: newlineCharact

Re: NSLocalizedString, genstrings, and Unicode

2008-08-15 Thread Aki Inoue
te: On 8/15/08 1:13 PM, Aki Inoue said: Yes, the compiler shipped with Xcode 3.0 and later supports UTF-8 in constant strings. Aki, Thanks for your reply. I'm not sure you understood however. I know that the compiler accepts UTF8 in constant NSStrings, but what I'm not sure abou

Re: NSTypesetter layoutParagraphAtPoint:

2008-08-13 Thread Aki Inoue
/13, at 14:04, chaitanya pandit wrote: Thanks Aki, that what exactly what i was looking for. Is there any documentation that describes other essential attributes that i need to set? Thanks again, Chaitanya On 13-Aug-08, at 12:38 AM, Aki Inoue wrote: You need to specify all essential glyph

Re: NSTypesetter layoutParagraphAtPoint:

2008-08-12 Thread Aki Inoue
You need to specify all essential glyph attributes for NSLayoutManager. In this case, you're not specifying the "not shown" attribute for the attachment. Attachment glyph should not be shown. Aki On 2008/08/12, at 19:54, chaitanya pandit wrote: Hello, Well i've been struggling with this f

Re: NSString sizeWithAttributes inaccuracy

2008-07-24 Thread Aki Inoue
Try using -boundingRectWithSize:options:attributes instead with NSStringDrawingUsesDeviceMetics. Aki On 2008/07/24, at 14:23, Jacob Ole Juul Kolding wrote: Hello List I'm working on an app where I have a NSTableView with one column containing strings. I want this column to automatically r

Re: How to detect NSTextAttachment deletion

2008-07-14 Thread Aki Inoue
Chaitanya, In general, whenever you want to detect user initiated editing, you can use -textView:shouldChangeTextInRanges:replacementStrings:. In this delegate method, look for NSTextAttachmentAttributeName in the editing range. Aki On 2008/07/14, at 9:37, chaitanya pandit wrote: Hi,

  1   2   >