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
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
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?
>
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,
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
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
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.
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
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
___
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
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
__
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
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
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
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
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
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
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
___
. 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
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
___
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
__
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
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
___
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
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
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
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
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
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
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
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
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
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
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
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
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
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
_
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
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
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
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.
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
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
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
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...
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
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
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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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.
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
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
_
. 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
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
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
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
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
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
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
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
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
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
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)
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
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
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
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/
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
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
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
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
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
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
__
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
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
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
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
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
_
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
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
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
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.
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
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
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
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
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
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 - 100 of 171 matches
Mail list logo