How can I bookmark a substring in NSTextView? - objective-c

In my app I want to provide bookmarks for text in NSTextView. Should I use RTF bookmarks?
And if so, how to determine their position later?
What options are possible to solve this problem?

See the Attributed String Programming Guide and the Text Attribute Programming Guide. You can set standard or custom attributes attributed strings (which NSTextView consumes) for a given range. You can also use an NSTextAttachment to show some sort of visible "anchor". Scroll the range of the attribute run or attachment to visible when the "bookmark" is selected.
Really, the sky is the limit in terms of "style". It just depends on what you're trying to do and how much functionality you want.

Related

Does a DCL Fonts Reference Exist?

I'm was going reviewing a few autolisp and dcl tutorials (afralisp & autolisp-exchange) to brush up on the dcl code. To cut to the question, I see that the text can be underlined by the mnemonic in afralisp and the & in autolisp-exchange.
Is there a better way to underline a string of characters?
Can a string be made bold, italicized, or strike-though with this
file type?
If the above is true, is there a reference webpage that has a list of fonts that can be used with the dcl file type?
This webpage may contain the solution, but I haven't seen how: AutoDesk.com
In short, you cannot arbitrarily change the GUI font face or style using standard DCL.
The ability to underline text is purely an exploit of the mnemonic property which allows DCL controls to be manipulated using keys on the keyboard which correspond to the underlined letters as opposed to using the mouse to click such controls.
Whilst DCL text has the is_bold property, this has never worked (and likely never will). One alternative is to feign bold text using the set_tile function in conjunction with an image tile; or you can use the fixed_width_font property, but, as the name implies, this will change the text to use a fixed width font (the exact font cannot be changed).
One other possibility is to display text using the vector_image function applied to an image tile, as I demonstrate in the 'About' dialog for my Incremental Numbering Suite application.

Highlighting text?

I've been searching for a while to know how Highlighting text (books on PDF, epub, mobi) works programmatically, what kind of code or tech stays behind this feature, yet I couldn't find anything. If you know, please share any hint here.
Thnx in advance
For PDFs you can highlight text by adding a highlight text markup annotation:
12.5.6.10 Text Markup Annotations
Text markup annotations shall appear as highlights, underlines, strikeouts (all PDF 1.3), or jagged (“squiggly”)
underlines (PDF 1.4) in the text of a document. When opened, they shall display a pop-up window containing
the text of the associated note. Table 179 shows the annotation dictionary entries specific to these types of
annotations.
(ISO 32000-1)
You can find details in Table 179. For a specification of annotations in general, read the earlier subsections of section 12.5 Annotations.
Alternatively you can also add the highlighting into the page content. This has the disadvantage that others cannot easily change the highlight (which actually might be an advantage in some use cases). Depending on the PDF viewers to support you might be forced to do this, though.

QlikView Text Object Formatting

I am unable to format the text in a text object. For example, I need headers in bold, while the body of the text could be normal. Can I get any hints on this?
I know this can be achieved via extension objects, but I do not have any experience creating them.
This is not currently possible in QlikView 11. It has been an open development request for quite some time.
You have two options:
Use multiple text objects and lay them over each other (i.e. make the topmost one bold and its background transparent).
Use an extension object, however, this then restricts you to AJAX/WebView for your document. There is an existing extension (written by Stefan Walther) that has this capability here (git repo).

Translating UI resources for Windows store apps

In XAML for strings that are to be displayed in localized language we need to identify its Width property and access it using x:Uid attribute.
If particular string width falls short of space how we can attain flexible layout and also we know German and Finnish require more space than English for text.
Is there any alternate way to get localized strings in XAML.
You can access the strings in code via a ResourceLoader object.

How to "mask" certain text in a PDF document

I have a PDF document, and I want to mask certain text blocks. The reason why I want to do this, is because I don't want this text to be indexed, nor I want this information to be easily accessible by selecting and copying this text block.
What should be the right way to do this?
I guess turning the text to raster would be bad idea, and I don't know if there is some tool that can make only cartain text parts with special privileges.
You will need a program that can convert a font into a series of shapes.
Illustrator may have the functionality you want: see here and here.