Fabric.js / Text Edit on mobile - fabricjs

I'm trying to use TUI Image Editor (https://github.com/nhn/tui.image-editor) in my Cordova app on Android.
It is based on Fabric.js and overall working reasonably, however I have major problems with the text annotation: If the edited text is in the lower part of the screen, the Android softkeyboard is covering the text input and doesn't scroll it into view. This also happens when I run the page in the normal Android Chrome browser.
Are there any recipes or examples how to get that working with Fabric.js?

I had the same problem, and I just avoided using the IText and Textbox objects. I just used the html input field and object with type Text in fabric.js without editing inside canvas, and editing inside input and changing text object to input value. Because if you will use the IText and Textbox objects, you will face problems with editing text on small texts, or text objects with a small scale, where editing inside canvas will be difficult and annoying.
If you still want to scroll to text object I can't give you a full solution. But I think you can use canvas events for text
canvas.on('text:editing:entered', (textObject) => {
// calculate canvas offset and textObject offset and scroll to this position
})

Related

How do you embed images into Acumatica Report hyperlinks?

We are trying to incorporate an image within a link on an Acumatica report.
We are very close to getting the result we need with the 2018R2 version and have a strategy for a workaround in the 2018R1 version.
The TextBox control Is the only way we have found so far that will allow for setting a hyperlink within an invoice report definition. We are able to set a background image in the Appearance/Style/BackImage property. The only way we can get the whole image to be clickable is to have text span the whole control which is fine if we can set the text font to use a transparent color. Setting the Appearance/Style/Color seems to be the property to do this however when the report is previewed the font gets overridden and displayed as the standard Hyperlink color. The behavior when the report is rendered as a PDF via Acumatica’s email delivery system the font appears white. See Images for a visual.
Transparent Text in Report Preview
Transparent Text in Rendered PDF
There looks to be an Appearance/StyleName property for the TextBox control is there an underlying CSS file that can be further manipulated to also control the LinkText properties to display the LinkText in a transparent font? If yes is there any documentation that would help with doing this.
The 2018R1 versions and prior do not render a clickable link within a PDF if the above strategy is used. Per the ticket, I opened last week on the topic the only way to get this link is to have the whole URL on a single line.
PDFs rendered from a invoice definition hosting a hyperlink will not create a clickable link
This makes it a challenge to control the placement of the image to be centered as well as having only the space within the first line as being clickable. We have solved this in a different ERP system by having multiple links overlapping a background image also using transparent font. This required us to set the Z order so that the link controls are rendered on top of the back-ground image. The Acumatica Report Designer however appears to not have the ability to control Z order. Any attempt to place a link overtop of an image does not achieve the result we are looking for. If we can get this strategy to work we will likely also use it for the 2018R2+ versions to keep things consistent.
This screenshot depicts the strategy attempted.
Are there any other strategies to meet this requirement?
Thanks in advance.
For Version 2018 R2:
You can use the TextBox->Style->BackImage property to show the image and the NavigateUrl property to set the URL link. Html mode doesn't display back image but PDF mode will display it fine and the image link works:
For Version 2018 R1:
Unfortunately I didn't find a way to achieve this because I can't get the text to render transparent when it is located over an image.
There is z-order control (bring to front/send to back) in the report designer toolbar and right click context-menu. The problem here is that while the report designer supports overlapping control the report renderer doesn't. If controls are overlapping, when printing the report the overlapping controls won't get rendered on top of another like they are in the designer.
Having overlapping controls isn't really required here because we can display the image with the Textbox Style->BackImage property or with the Report->Style->BackImage.
It's also possible to make text font size bigger so you don't need multiple text box or set multiline=true with textwrap=false and repeat link on each line.
But the main issue remains rendering transparent text over an image. I couldn't find a way to do that. When there's an image under the text, the text is no longer transparent. That behavior happens for the textbox background image as well as the global report background image. This suggests to me that it might not be possible to put transparent text on top:

Layout of text/spacing changes in TextArea when clicking on it

I have a CodenameOne application which has a TextArea that should display a multi-line text.
When I run the app in the simulator and click on the text-area, the spacing between the lines and possibly also between the characters change so that the area that the text occupies shrinks a bit.
Why is this?
What should I do to prevent it?
That is due to the switch from our drawing to the native editing which will always render things slightly differently. E.g. things like line spacing are really hard to get accurately for every native device.
TextArea has a setRowsGap method that allows you to specify the spacing between rows in pixels but since this differs between OS's its probably not ideal.

XPages RichText width properties

Using the insert image button of the rich text editor in xpages, you are given an option to resize the width and height of the image. After saving and returning the image returns to the original size. Is there a step I am missing or version bug with this item?
This is not an "answer" exactly, but I used the TinyMCE custom control on OpenNTF to replace using the native rich text control. I've had good luck with it. http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=XPages%20Tinymce%20Custom%20Control

Javafx while selecting text using mouse in webview the selecting word is split or overlap

I want to select the text in webview while i am selecting text content using mouse in webview, the selected text word is split or the mouse selecting first word alignment overlap. how to solve this issue.
Just i have load a simple html file in javafx weview component. while select the text in webview the word is split or overlapping. i am not use any JavaScript.
You can find the doubt in the following link:
enter link description here
WebView not correctly rendering selection areas is a known issue in JavaFX 2.2:
RT-18883 Google docs editing issues
RT-11239 Add draw glyph type support to Prism graphics

Qt text editor on picture

I haven't found an exact question on this.
I have a picture, it could be blank for the sake of the example, or contain something that I want to add a fancy caption to. I want to add text editing means (akin to Photoshop) on top of the picture.
I'm thinking about subclassing QGraphicsScene and placing a subclassed QTextEdit object on the scene upon pressing a text placement button. Then, when you click on this object, in addition to editing the text, additional text editing tools become available - so you can set parts of text to bold, italic, modify color, size, etc. And then you would be able to change the object's position - and I think that's available in QGraphicsScene by default. And for the background QBrush, there would be a background picture.
Is this a reasonable solution?
Maybe there are any ready-available examples of this, but I haven't found them yet.
My solution
Text item:
For the text item, I used QGraphicsScene with a subclassed QGraphicsTextItem. For the background picture, I used a QGraphicsRectItem with a QBrush and a loaded picture using QImage methods.
To edit parts of the selected text in this subclassed QGraphicsTextItem:
QTextCharFormat applied to my subclassed QGraphicsTextItem using QGraphicsTextItem::textCursor().mergeCharFormat(...). This way I can change formatting, such as boldness, italics, etc. on the selection only.
Some more thingies:
To pan and zoom around the scene, I used an excellent guide by Vpicaver complete with source code from http://www.qtcentre.org/wiki/index.php?title=QGraphicsView:_Smooth_Panning_and_Zooming

Resources