Adding Multiple NSTextContainers to an NSLayoutManager - uitextview

I notice that you can add multiple text containers to a layout manager in Objective-C using the addTextContainer:(NSTextContainer *)textContainer selector. Using TextKit, I've only ever had to add one text container, and when messing around with multiple text containers, all of the textviews just get filled with the same text from the text storage linked to the layout manager. I'm simply curious, but when would I ever need to add multiple text containers to one layout manager?

One NSLayoutManger to Multiple Text Containers when you need the text within the associated NSTextStorage to span over multiple pages (normally would each be an NSTextView) as in a word processor spreading its text over multiple pages.
The NSLayoutManager is clever enough to split the text in NSTextStorage into each NSTextContainer.

... the NSTextStorage object’s data and lay them out within the area defined by the NSTextContainer object.
This configuration is limited by having only one NSTextContainer-NSTextView pair. In such an arrangement, the text flows uninterrupted within the area defined by the NSTextContainer.
Page breaks, multicolumn layout, and more complex layouts can’t be accommodated by this arrangement.
By using multiple NSTextContainer-NSTextView pairs, more complex layout arrangements are possible. For example, to support page breaks, an application can configure the text objects as shown in Figure 3-4.
Common Configurations
https://developer.apple.com/library/content/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextSystemArchitecture/ArchitectureOverview.html

Related

How/which format to create multi-page printable documents with precise geometry/layout?

I would like to automatically generate calendar pages with very specific information and a very specific layout and ideally have all pages in a single document (can be PDF, doesn't have to be). For they layout of the boxes, text placement etc. I would like to be able to control the geometry very precisely so it's the same on every page and reproducible.
I could create SVG with exact dimensions, but I'm not sure about the part where I actually turn it into a document for printing.
With LaTeX I can most likely generate what I would like to have, but am unsure whether I have precise enough control over the dimensions of all my elements.
Creating Postscript or even a PDF "from scratch" seems a little too intimidating.
I know there may be more than one solution to this, but I'm happy to explore several options and see what works best with my experience.

How to rotate text in Kofax Transformation?

I'am new in Kofax. Task - to recognize a couple of vertical words. Almost all text in document is horisontal. Only two words - vertical. In Kofax Capture I can do it easily:
My task - do the same in Kofax Transformation. I did not find a standard solution. I also could not find solution in Internet (for example some tricky script). Is this possible in Kofax Transformation?
Thank you in advance.
OCR comes in two flavors in Kofax Transformations:
Page profiles. As the name suggests, a page profile is used to read the entirety of one individual page.
Zone profiles. These profiles are typically used with an Advanced Zone Locator.
Page profiles can rotate a given page. Imagine you have a document with three pages, and page number is is in landscape - if permitted, the OCR profile will rotate page number 2 while 1 and 3 will remain unchanged (i.e. portrait).
However, a page profile can only rotate the page as a whole -- not individual paragraphs or words. Moving forward, here are your options:
If your text appears always at the same location: use an Advanded Zone Locator.
If your text can be anywhere, try anchoring with a different locator (Format Locator), and move your AZL's zone by script (you can use some the parts from this link).
If neither is true or possible, you can rotate the page in script, and the re-execute a different page profile. Here's some code to get you started.

setCoords of all objects in group in fabricjs

Im currently developing a editor for customizing signs and ran into a problem with positioning text element after an increase of the font size. The text objects is currently in a group but its possible to set font-size of each individual object. When increasing font size I need to setCoords for the full group, otherwise the end-user is not able to move it properly.
Can I use setCoords on the Group Object or do I need to loop through all objects in the group and set coords on each individually, if this is the case, any suggestions how to do that?
Thanks
I have written an editor for seat reservation system with using of Fabric.js. One of the features is cloning selected objects. Selected objects are cloned, moved right and bottom and this new group of objects is marked as active group. After clonning and shifting I am using group.setCoords() and group.saveCoords() and everything works fine. Check my example here.

Do I need to create All folders for layout for all screen sizes?

I am creating an app targeting all screen sizes and densities.
Do I need To put my layout in all folders named-
layout-large-port
layout-large-land
layout-small-port
layout-small-land
layout-normal-port
layout-normal-land
layout-xlarge-port
layout-xlarge-land
or there is any other standard way?
Also, what about the text size in each layout? If I need large font in xlarge size an small font in small size, then how to adjust same?
Android tries to find the most specific match when looking for a resource. If none is found, it will try less and less specific until a match is found. So for example, if you're running on xlarge-land, then it will look for any resource first in layout-xlarge-land, then in layout-xlarge or layout-land (not sure which order) and finally in the unqualified layout. This means if you design your layout XML's in such a way that they're generic, you don't have to provide every possible bucket.
The Supporting Different Screen Sizes section of the Android Developer Training goes into this in detail. It also includes a useful "layout alias" trick that you can use to avoid copy-paste coding.

wxWidgets Linux GCC, how to add scroll bar into wxFrame

My application has a GUI, it first reads a initialization file and then decides how many control objects (e.g., wxTextCtrl, wxToggleButton, etc.) need to be added to a wxFrame. When there are too many objects on the wxFrame, some objects are out of visible boundary, i.e., they are on the wxFrame, but user can not see them.
I am wondering whether it is possible to add a vertical and a horizontal scroll bar into wxFrame.
Thanks.
You should not add controls to a wxFrame. The wxFrame can be used to hold windows, including scrolled windows, on which controls can be placed.
Take a look at some of the sample apps in the distribution to see how this works.

Resources