Re: rangeOfString with .RegularExpressionSearch not matching begin and end of line (Swift)

2015-06-12 Thread Douglas Davidson
By default those match beginning and end of string. If you use NSRegularExpression, there's an AnchorsMatchLines option to control this behavior. Douglas Davidson > On Jun 12, 2015, at 3:41 AM, Antonio Nunes wrote: > > Hi, > > I a trying to find a line within a

Re: NSSpellChecker exception

2014-08-12 Thread Douglas Davidson
NSSpellChecker uses DO to connect with the spellchecker process. It properly handles any exceptions that may result, so these exceptions would be caught and handled and you do not need to be reporting them. Douglas Davidson On Aug 12, 2014, at 5:22 PM, Dragan Milić wrote: > I'm

Re: NSSpellChecker -ignoreWord:… for NSTextCheckingTypeGrammar?

2013-08-16 Thread Douglas Davidson
nored. It would be perfectly reasonable for you to maintain your own ignore list and filter grammar-check results based on it. Douglas Davidson On Aug 8, 2013, at 7:41 AM, Troy Stephens wrote: > Is NSSpellChecker’s “ignored words” API meant for use with grammar-checking > results too? >

Re: Localization not working based on region with en-US, en-UK and en lproj

2013-02-03 Thread Douglas Davidson
The localization used is determined by matching the AppleLanguages list against the localizations available in the application's main bundle. In this case, the top entry in AppleLanguages is en, so that is the localization that will be used. Douglas Davidson On Feb 3, 2013, at 6:56 AM,

Re: splitting CJK text into "words"

2012-09-26 Thread Douglas Davidson
On Sep 26, 2012, at 2:12 PM, Martin Wierschin wrote: > I've tried a variety of locale identifiers (eg: "zh", "jp_JP", etc) but no > joy. Am I missing something? Try "ja" for Japanese text, "zh-Hans" for Simplified Chinese text, "z

Re: order of NSRegularExpression matchesInString result

2012-08-15 Thread Douglas Davidson
The matches should be returned in order. Douglas Davidson On Aug 15, 2012, at 8:33 AM, Koen van der Drift wrote: > I am using NSRegularExpression to search for certain words in a > string. To interrogate the results I use something like: > > NSArray *matches = [regul

Re: Losing attachments when saving rtfd

2012-04-25 Thread Douglas Davidson
eWrapper containing the image file you want written out, or they cannot be written to disk. Note that the display of the attachments is controlled by the NSTextAttachmentCell, which can work fine even if there is no file representation for the image.

Re: drawing lines in and NSTextView

2012-03-31 Thread Douglas Davidson
On Mar 31, 2012, at 6:09 PM, Graham Cox wrote: > > On 31/03/2012, at 11:08 PM, Koen van der Drift wrote: > >> I have an NSTextView to which I want to add some lines that connect >> certain words. When the text changes, either by editing, or scrolling, >> that lines should follow the words. I

Re: Displaying an arbitrary unicode character using CGContextShowTextAtPoint or CGContextShowGlyphsAtPoint

2012-03-30 Thread Douglas Davidson
nderer will substitute glyphs from > appropriate fonts as needed. They are in fact very low-level indeed, so ignore them unless you're prepared to write your own Unicode layout engine on top of them. Use the string drawing APIs instead. Douglas Davidson ___

Re: NSTextView, spell checking and temporary attributes

2012-01-02 Thread Douglas Davidson
Are you making other modifications to temporary attributes? The spelling indicator does use various temporary attributes, though not background color, so (for example) clearing temporary attributes would interfere with it. Douglas Davidson On Jan 2, 2012, at 10:20 AM, Martin Hewitson wrote

Re: Natural language

2011-11-17 Thread Douglas Davidson
orthographyWithDominantScript:@"Latn" languageMap:[NSDictionary dictionaryWithObject:[NSArray arrayWithObject:@"en"] forKey:@"Latn"]] range:NSMakeRange(0, length)]; which specifies that the text is to be treated as being entirely in English. Douglas Davidson __

Re: Natural language

2011-11-14 Thread Douglas Davidson
Reference/NSLinguisticTagger_Class/Reference/Reference.html>. If you have specific questions, you can send them to the list. Douglas Davidson On Nov 14, 2011, at 7:02 AM, Luca Ciciriello wrote: > Yes, indeed!!! > > On Nov 14, 2011, at 2:56 PM, Eric E. Dolecki wrote: > >> Just started watc

Re: How to highlight the current line in NSTextView?

2011-11-04 Thread Douglas Davidson
The NSLayoutManager will tell you. Try taking a look at the conceptual documentation and some of the sample code for NSLayoutManager, and let me know if you have any problems. Douglas Davidson On Nov 4, 2011, at 6:19 AM, Nick wrote: > Hello > Basically the question is about getti

Re: using AppKit additions in background threads

2011-09-06 Thread Douglas Davidson
One possibility would be to convert the HTML to RTF or RTFD, which could be loaded in the background. For that sort of conversion we already have a tool on the system, /usr/bin/textutil. There are also other potential methods for parsing HTML, i

Re: using AppKit additions in background threads

2011-09-06 Thread Douglas Davidson
it will use WebKit to do part of the work, and WebKit runs exclusively on the main thread. The AppKit methods can be invoked on arbitrary threads, but they will transfer WebKit work to the main thread as needed. Douglas Davidson ___ Cocoa-dev mailin

Re: Opening a file read-only?

2011-08-10 Thread Douglas Davidson
nit > time (into a single malloc allocation, no less). >From the header: "These methods are deprecated. You should use >+dataWithContentsOfURL:options:error: or -initWithContentsOfURL:options:error: >with NSDataReadingMappedIfSafe or NSDataReadingMapp

Re: Using a Soundex category...

2011-07-06 Thread Douglas Davidson
t; > Any ideas or perhaps a different Soundex implementation I could try? I > am already using Levenstein distance, but on it's own it's not good > enough. Those results sound perfectly reasonable based on the versions of Soundex that I have seen. Perhaps you are looking fo

Re: Dynamically loading NIB files with a common stem

2011-07-06 Thread Douglas Davidson
ces in question are not in a subdirectory. From the header comments: "subpath is a relative path to a subdirectory inside the relevant global or localized resource directory, and should be nil if the resource file in question is not in a subdirectory." Douglas Davidson ___

Re: Writing extremely large RTF or .doc files

2011-06-18 Thread Douglas Davidson
. NSAttributedString can also read it back in later, or if needed /usr/bin/textutil can convert to other formats. Douglas Davidson On Jun 17, 2011, at 10:49 PM, Dave DeLong wrote: > Fair enough. This is certainly a great alternative to stripping out the > document level attributes, but I'd still

Re: Properly comparing file NSURLs for equality?

2011-05-27 Thread Douglas Davidson
free bridging. It shouldn't be necessary to go to FSRefs for this now that we have resource properties such as NSURLFileResourceIdentifierKey/kCFURLFileResourceIdentifierKey. For other usages of FSRefs, consider file reference URLs instead. Douglas Davidson ___

Re: Linearly Scaling Text

2011-05-25 Thread Douglas Davidson
t is not. I've also tried using the NSView > method scaleUnitSquareToSize: - however this produces fuzzy text. Try taking a look at the source code for TextEdit--it's available as sample code, and it gives an example of scaling for NSTextViews. Douglas Davidson __

Re: text orientation/positioning with layout manager

2011-01-31 Thread Douglas Davidson
The layout manager expects to be drawing within a flipped context. Douglas Davidson On Jan 31, 2011, at 2:09 PM, Todd Heberlein wrote: > I'm doing a simple experiment using NSTextStorage, NSLayoutManager, > NSTextContainer to draw some text (I am basing this on the CircleV

Re: dylib clarification

2011-01-11 Thread Douglas Davidson
preference, > dlopen or CFBundleLoadExecutable for handling DLLs? If the executable you are trying to load is bundled, then CFBundleLoadExecutable will probably be more convenient. If not, then it may be easier to use dlopen directly. Douglas Davidson ___

Re: Strange error solved by turning off "Non-contiguous Layout"

2010-12-22 Thread Douglas Davidson
you save. That will cause the entire text to be laid out, as it would be if the window showed all of it. It would also be helpful if you could file a bug with enough information to reproduce this. Douglas Davidson ___ Cocoa-dev mailing list (Coc

Re: What defines a paragraph in NSText*?

2010-12-11 Thread Douglas Davidson
attribute will be automatically fixed at attribute fixing time so that it is constant over each paragraph range, because that is needed at layout time. Douglas Davidson On Dec 11, 2010, at 1:10 PM, Rob Nikander wrote: > Hi, > > I first asked this question on stackoverflow, so I&#

Re: Cocoa Text System - Temporarily Disabling Layout

2010-09-24 Thread Douglas Davidson
On Sep 23, 2010, at 7:54 AM, Jonathan Dann wrote: > In our app, Kaleidoscope, I have 2 text views side-by-side. In one > configuration the layout of the text in each text view is dependent both on > regions of layout in the "sibling" text view, and the model objects which > represent the the i

Re: creating docx file

2010-09-20 Thread Douglas Davidson
would > call a docx file. Any thoughts? fileWrapperFromRange... is what you use when you want something that has a directory structure on disk, e.g. RTFD. Use dataFromRange... instead. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.app

Re: AttributedString from NSData on iPhone.

2010-08-07 Thread Douglas Davidson
My recommendation would be that anyone who has needs of this sort should file a bug giving details of the particular needs you have for your application. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: loading French strings being in English language

2010-07-23 Thread Douglas Davidson
e using -pathForResource:ofType:inDirectory:forLocalization:, load it using any of the standard property-list methods (e.g. dictionaryWithContentsOfFile: or propertyListFromData:mutabilityOption:format:errorDescription:) and look up the key in the resulting dictio

Re: NSString ambiguities

2010-06-30 Thread Douglas Davidson
On Jun 30, 2010, at 3:02 PM, Ariel Feinerman wrote: > If we read whole file as a NSString, will be any conversions between \r\n, > \r, \n? Then if not, will be -componentsSeparatedByCharactersInSet: > [NSCharacterSet newlineCharacterSet] create empty strings in Win \r\n case? > So what is the bes

Re: NSAttributedString with columns

2010-06-14 Thread Douglas Davidson
vely simple way to do this is to write your text and formatting in HTML, and use NSAttributedString's HTML import functionality to convert it into NSAttributedString's table format. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.a

Re: font glyphs on different hardware

2010-06-01 Thread Douglas Davidson
Let me second Alastair's recommendations. Our standard developer example for this sort of thing is in the SpeedometerView example code, in the SpeedyCategories.m file; take a look at the BezierConversions category on NSString, and the associated BezierNSLayoutManager. Douglas Davidson

Re: How can i disable "multiple selection" on a NSTextView

2010-05-24 Thread Douglas Davidson
There are delegate methods for controlling selection that will allow you to impose all sorts of restrictions on the possible selections, including this. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin reque

Re: [iPhone] How to create a unique string

2010-05-13 Thread Douglas Davidson
that is supported. The use of the MAC address was removed because of privacy concerns. CFUUID generation is only probabilistically unique, but the probability of collisions is vanishingly small. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-d

Re: How do you set the text in an NSTextView?

2010-05-07 Thread Douglas Davidson
iled modifications are best done by operating on the text storage, which is a subclass of NSMutableAttributedString. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: Help with text input

2010-04-30 Thread Douglas Davidson
On Apr 30, 2010, at 9:59 AM, Charles Srstka wrote: > On Apr 30, 2010, at 11:41 AM, Douglas Davidson wrote: > >> Here is the normal sequence when a text-handling view receives key events: >> the keyDown: method passes events to interpretKeyEvents:, which is where >> th

Re: Help with text input

2010-04-30 Thread Douglas Davidson
are mostly listed in NSResponder.h. The default NSResponder implementation of doCommandBySelector: checks whether the receiver responds to the given selector, and if so calls it; otherwise it is passed on to the next responder's doCommandBySelector:. Douglas Davidson _

Re: Help with text input

2010-04-29 Thread Douglas Davidson
key support but also input from arbitrary sources such as input methods. The easiest way to do this is to make use of an existing class that implements them, such as NSTextView--that's how the standard Cocoa controls do it--but it's always open to you to implement them yourself i

Re: CFUUID question

2010-04-28 Thread Douglas Davidson
nd this doesn't seem possible with CFUUID. CFUUIDCreate() generates a new random UUID. CFUUIDCreateWithBytes() and CFUUIDCreateFromString() create CFUUID objects based on existing values. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@list

Re: Getting a bezier path for a character

2010-04-28 Thread Douglas Davidson
Take a look at bezierWithFont: in the SpeedyCategories.m file. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-d

Re: CSS style string to NSAttributedString attributes conversion

2010-04-08 Thread Douglas Davidson
se anything to handle CSS by itself, but if CSS is applied to HTML, AppKit's HTML import will convert it to attributes on the text. You might be able to make use of that. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.

Re: Custom NSTextView for text annotations

2010-03-29 Thread Douglas Davidson
numbers in the margins of a text view, which could give you a place to start from. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at

Re: How to relayout content of NSTextView so that my tab characters are drawn with width of 4 characters

2010-02-19 Thread Douglas Davidson
uld probably want to surround this with calls to shouldChange/didChange methods--take a look at some of the samples for code examples of this sort of thing. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not p

Re: -[NSBundle preferredLocalizations]

2010-02-10 Thread Douglas Davidson
On Feb 10, 2010, at 5:52 AM, Kai Brüning wrote: > Could somebody with insight confirm whether this is a documentation bug? This is indeed an error in the documentation. Please file a bug against the documentation with the information you have provided. Douglas Davidson

Re: NSLayoutManager vertical offset mystery

2010-02-06 Thread Douglas Davidson
Use a flipped context. Douglas Davidson On Feb 6, 2010, at 2:20 PM, Andy O'Meara > wrote: Hi gents, I have a small cocoa text layout issue that I could use some help from the veterans here, and I've been unable to make progress using google, ADC, or the list archives...

Re: Arbitrary Attributes affect text layout

2010-02-02 Thread Douglas Davidson
ou should file a bug about the problems you have been seeing, but I'd suggest using rangeOfComposedCharacterSequenceAtIndex: and the like as a workaround. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post a

Re: Arbitrary Attributes affect text layout

2010-02-02 Thread Douglas Davidson
ttributes to clusters, using rangeOfComposedCharacterSequenceAtIndex: et al., rather than to individual characters. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Con

Re: Setting the Line Height/ Line Spacing in an NSTextView.

2009-12-24 Thread Douglas Davidson
Use a paragraph style. Douglas Davidson On Dec 24, 2009, at 10:25 AM, Joshua Garnham wrote: How would I set the Line Height/ Line Spacing in an NSTextView? e.g How tall each line is or how much space is between each line. Thanks

Re: NSRecursiveLock problems

2009-12-23 Thread Douglas Davidson
occur for your layout manager while you are using it on a background thread. If you have done that and still see threading issues, please file a bug. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Releasing an NSBundle

2009-12-21 Thread Douglas Davidson
e and wish to continue to use the code from it, you should keep a reference to the NSBundle for as long as you continue to use it. This is definitely the case for code loaded using CFBundle--if you want to continue using it, keep a reference to the CFBundle. Douglas Dav

Re: NSTextView Bad Behavior

2009-12-14 Thread Douglas Davidson
On Dec 14, 2009, at 10:50 AM, Gordon Apple wrote: Any ideas on how to force a full layout and then prevent NSTextView from further mucking with it? One of NSLayoutManager's -ensureLayout... methods would be a good bet here. Douglas Dav

Re: Unable to write in InfoPlist.strings file from cpp

2009-12-10 Thread Douglas Davidson
If you use the XML or binary plist format, the contents must be a dictionary of strings. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderato

Re: Saving position in NSTextView

2009-12-04 Thread Douglas Davidson
Container:, and convert the resulting glyph range to a character range. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at coco

Re: Finding a word from a character position

2009-12-03 Thread Douglas Davidson
lickAtIndex:. Note that -characterIndexForPoint: is intended for input methods, not for setting the insertion point. Try - characterIndexForInsertionAtPoint: instead. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post ad

Re: How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Douglas Davidson
ystem "bug" because there are no namespaces, and for the same class name there is only one bundle. As others have said, don't do this. However, to answer your question, the other way to locate your bundle is via bundleWithIdentifier:

Re: NSString of selected text in NSTextView

2009-11-09 Thread Douglas Davidson
On Nov 9, 2009, at 9:37 AM, Kyle Sluder wrote: On Mon, Nov 9, 2009 at 9:28 AM, Douglas Davidson wrote: Yes, that's correct. Within a given text view, the character indexes are the same between the text storage and its underlying string, and these are the character indexes used b

Re: NSString of selected text in NSTextView

2009-11-09 Thread Douglas Davidson
text storage and its underlying string, and these are the character indexes used by the layout manager and the text view. Processes such as copying and pasting, on the other hand, may not preserve character indexes. Douglas Davidson ___ Cocoa-dev

Re: NSString of selected text in NSTextView

2009-11-07 Thread Douglas Davidson
extStorage). Douglas Davidson On Nov 7, 2009, at 6:06 PM, Kyle Sluder wrote: On Sat, Nov 7, 2009 at 5:57 PM, Todd Heberlein wrote: This seems like a simple task, but it has become a series of steps. Am I missing a simple method that will do this? [[myTextView string] substrin

Re: NSString of selected text in NSTextView

2009-11-07 Thread Douglas Davidson
NSTextView will usually take care of making sure that the selection is a reasonable range. One complication is that in general NSTextView supports multiple discontiguous selection ranges, and if such a selection is in use, calling just -selectedRange will ignore it. On Nov 7, 2009, at 6:0

Re: NSString's handling of Unicode extension B (and C) characters

2009-11-05 Thread Douglas Davidson
line of text as it is laid out. Note that insertion point boundaries are not identical to glyph boundaries; a ligature glyph in some cases, such as an "fi" ligature in Latin script, may require an internal insertion point on a user-perceived character boundary." Douglas D

Re: Extract plain text content from a Text View

2009-10-16 Thread Douglas Davidson
NSTextStorage is a subclass of NSMutableAttributedString. Is that enough of a hint? Douglas Davidson On Oct 16, 2009, at 12:37 PM, Ian Piper wrote: Hi all, Is there a way to get the plain text content out of an NSTextStorage object (displaying using a Text View) that contains rich text

Re: language based scaning,

2009-10-15 Thread Douglas Davidson
e NSGlyphAttributeBidiLevel in NSLayoutManager, but that's probably more detailed than you really want. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: Automatic language detection - a bug (again) or what. Snow Foundation NSSpellServer.

2009-10-08 Thread Douglas Davidson
File a bug against NSSpellChecker and we will look into it. Douglas Davidson On Oct 8, 2009, at 1:35 PM, MacProjects wrote: Hello! I'm maintaining system-wide Latvian spell checker for ~ 2 years. It works as intended on 10.4 and 10.5. Just made a dummy spellcheck for 10.6. checkin

Re: NSAttributedString always returns NO for -isEqualToAttributedString with attachments present?

2009-10-07 Thread Douglas Davidson
have a notion of equality distinct from identity. If you need to compare two attributed strings, you may need to consider exactly what notion of equivalence you're looking for, and implement something to test for that. Douglas Davidson _

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

2009-09-25 Thread Douglas Davidson
. However, for purposes of getting them into an NSString, you can (for example) represent them in UTF-32 and use one of the conversion methods. Alternatively, you could put them in a file, maybe a text file or a plist, and let the standard import methods deal with encoding issues. Douglas

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

2009-09-25 Thread Douglas Davidson
o get a bezier path from text--look at bezierWithFont: in http://developer.apple.com/mac/library/samplecode/SpeedometerView/listing9.html . Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin reques

Re: Distinguishing between return and enter in NSTextField

2009-09-03 Thread Douglas Davidson
Try taking a look at the current event. Douglas Davidson On Sep 3, 2009, at 11:18 AM, Rick Mann wrote: I would like to use the delegate, but it sends me insertNewLine: for both keys. Is there another method I can implement? On Sep 3, 2009, at 11:14:20, Douglas Davidson wrote: Short

Re: Distinguishing between return and enter in NSTextField

2009-09-03 Thread Douglas Davidson
Short answer: no. Stay away from keyDown: and look at delegate methods instead. I have a standard rant on this topic; I don't have it handy but it should be in the list archives. Douglas Davidson On Sep 3, 2009, at 10:54 AM, Rick Mann wrote: Hi. I'd like to insert a new lin

Re: Normalize an NSAttributedString

2009-08-26 Thread Douglas Davidson
nd of thing for display only? Unfortunately, there's no guarantee that something like this will work. Depending on the font, something like an o+umlaut may be represented with a single glyph, in which case there's currently no mechanism for colorin

Re: NSTextView - "Image Editing"?

2009-07-27 Thread Douglas Davidson
es that option do, and is there any easy way that I could use the "Image Edit" panel within an NSTextView? This option is advisory for attachments; unfortunately the attachment classes do not yet implement this functionality, so if you want to pop up a panel you would need to

Re: Efficiency of loading Localizable.strings and NSUserDefaults

2009-07-15 Thread Douglas Davidson
lways all be cached indefinitely, but in general you can expect that subsequent requests for the same string after the first will be fast. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin reques

Re: document specific "as-you-type" spell checking

2009-06-25 Thread Douglas Davidson
eld editor? If you provide a custom field editor, you can override - spellCheckerDocumentTag. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the mod

Re: -replaceTextStorage: problem

2009-06-08 Thread Douglas Davidson
ck what you're doing, and make sure you're calling the super methods. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at c

Re: Hiding Glyphs

2009-06-05 Thread Douglas Davidson
suitable to subtracting from the displayed glyphs. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.appl

Re: How heavy is NSLayoutManager?

2009-06-03 Thread Douglas Davidson
tion, as long as you are not expecting to scale that number up by several orders of magnitude in the future. However, every application's usage pattern is different. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: using fileWrapperFromRange: for lossy conversion

2009-05-20 Thread Douglas Davidson
ibly meaningful in plain text, without their attachments. If you want to strip them out, you can take a look at the source code for TextEdit, which removes attachments when converting documents to plain text. Douglas Davidson ___ Cocoa-dev

Re: Breaking underlining on descenders

2009-05-13 Thread Douglas Davidson
ic interface that would make this easy, but you could probably put something together. You can file an enhancement request for suitable API. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: Creating NSAttributedString objects using WebKit in secondary thread

2009-05-11 Thread Douglas Davidson
On May 11, 2009, at 10:53 AM, Dragan Milić wrote: Is there any way to initialise and use WebKit out of the main thread? No, there isn't. This is a fundamental restriction on the use of WebKit. Douglas Davidson ___ Cocoa-dev mailing

Re: Using CFStringTransform with Attributed strings or runs, maintaining the styling of the Attributes in transformed results.

2009-04-20 Thread Douglas Davidson
n length due to the transforms. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/

Re: IsBadCodePtr in Cocoa or Unix?

2009-04-16 Thread Douglas Davidson
ossible to find out all sorts of information about the address space of a process via various Mach APIs. This is pretty deep stuff, so I won't even start to explain it in a mail message; if you want to do it, you had better understand it thoroughly

Re: Screen Savers

2009-04-10 Thread Douglas Davidson
ailable if there's no obviously suitable class to use with +bundleForClass:. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at c

Re: NSTextView trackingArea problem

2009-02-26 Thread Douglas Davidson
see whether the mouse is in your region of interest yourself, rather than using a tracking rect. Be sure to call [super mouseMoved:] in the overriding method. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: Encoding to use for file names

2009-02-05 Thread Douglas Davidson
e for this method: "To convert a char * path (such as you might get from a C library routine) to an NSString object, use NSFileManager‘s stringWithFileSystemRepresentation:length: method." Douglas Davidson ___ Cocoa-dev mailing

Re: How to draw text with fade out effect?

2009-01-30 Thread Douglas Davidson
different affine transforms rather than varying alphas. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at

Re: NSTextView.preferredPasteboardTypeFromArray

2009-01-28 Thread Douglas Davidson
work. But it feels like I'm doing the wrong thing somehow, since from the doco it sounds like you shouldn't return a type that is not in the allowedTypes. Try overriding -acceptableDragTypes as well as -readablePasteboardTypes. Douglas Davidson __

Re: NSTextView and automaticLinkDetection

2009-01-20 Thread Douglas Davidson
this evaluation. This functionality is not yet available. However, we do provide - URLAtIndex:effectiveRange:, which you could use to implement this yourself. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: Overriding NSTextField keyDown?

2009-01-06 Thread Douglas Davidson
t need to convert to strings. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Uns

Re: Overriding NSTextField keyDown?

2009-01-06 Thread Douglas Davidson
a custom field editor, you wouldn't want to override keyDown:, because doing so will break most input methods. Dealing with raw key strokes is too crude for the needs of modern text input--that's why we have all of these other override points. Check the a

Re: Localize Attributed Strings?

2009-01-06 Thread Douglas Davidson
your localized strings and used NSAttributedString's HTML conversion to get attributed strings; etc., etc. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments t

Re: [SOLVED--AGAIN] Re: Printing a range of text in a particular container --

2009-01-06 Thread Douglas Davidson
lay out the text for you. Alternatively, of course, you could use two different layout managers and text storages--if the two pieces of text are really being displayed independently, they may not actually belong in the same document. Douglas Davidson _

Re: Reversing a String

2009-01-06 Thread Douglas Davidson
ter scrambling-- anagram generation, for example--but they really only make sense within a limited character repertoire, so it would be necessary to filter the input based on some appropriate character set. Douglas Davidson ___ Cocoa-de

Re: NSAttributedString -> XHTML 1.1

2008-12-16 Thread Douglas Davidson
s HTML generation has not been configured or tested for the generation of XHMTL 1.1. It does not currently make use of the lang attribute or map element, or the name attribute on a elements, and it is unlikely to do so in the future, but I'm not prepared to make further

Re: NSSocketPort == BSD Socket

2008-12-05 Thread Douglas Davidson
ities such as CFSocket or CFNetwork, not an NSPort subclass. It is possible to create an NSSocketPort, then extract the socket and use it separately, but that isn't really using an NSSocketPort. Douglas Davidson ___ Cocoa-dev mailing list (Coco

Re: very different width for space character when not using screen fonts

2008-12-02 Thread Douglas Davidson
ahead and file a bug and we'll track it down. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.

Re: Figure out the size of an NSAttributedString

2008-11-26 Thread Douglas Davidson
even after drawing it to an intermediate image if I really need to?) You'll find the methods you need right alongside those for drawing the attributed string, in NSStringDrawing.h. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.app

Re: Live editing an NSTextView

2008-11-26 Thread Douglas Davidson
you could set a flag noting that your change is in progress, and clear it when your change is done. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. C

Re: Remove HTML Tags

2008-11-24 Thread Douglas Davidson
actually want out of an HTML to plain- text conversion process, and examine the various options available to you to see how well they agree with what you want. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post ad

Re: Is -rangeOfUserTextChange: supposed to wipe out marked text/diacritical marks?

2008-11-20 Thread Douglas Davidson
on such validation code, suddenly accented characters stop working. Yes, these methods unmark the text. They're generally intended to be called when a change is actually going to be made. One alternative would be for you to call -isEditable and -selectedRange in your validation co

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

2008-11-18 Thread Douglas Davidson
hen I need to rejig things so the complex custom views embed an NSView rather than draw the attributed string manually. The other alternative would be to use the NSStringDrawing APIs instead of using NSLayoutManager directly. Douglas Dav

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

2008-11-18 Thread Douglas Davidson
like those of NSTextView." If you are going to be drawing using the layout manager directly, this is a hard- and-fast rule. Douglas Davidson ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

  1   2   >