How do I print characters that are not defined in UTF-8 as "images"?

Asked 2 years ago, Updated 2 years ago, 54 views

I am developing an application called Zinnia-Tomoe that allows iOS devices to input and output kanji using a license-free handwriting recognition engine.
You can think of Zinnia as an online input application that can recognize symbols and other pen strokes, and Tomoe as a character output application that uses Zinnia's functions to input Japanese kanji and simplified Chinese offline.

What I want to do is input and output a large number of characters that are not defined in UTF-8 as non-Chinese characters as images.

Tomoe has the ability to arrange a list of coordinates called "S" in a certain order to eventually form a kanji stroke.

Disclose some of the S expressions.

(character(value1)(width1000)(height1000)(strokes(75464)(923468)))
(character(value)(width1000)(height1000)(strokes(93198)(913205))(495203)(470847)(405784)))

In this way, it consists of a list of characters you want to print and numbers indicating coordinates, and eventually recognizes kanji by handwriting by following the coordinates.

However, UTF-8 is struggling to use undefined non-Chinese characters as new characters in the app, and I want to avoid the problem by using them as images as a means of doing so, but this doesn't work very well.

For example, UTF-8 does not define characters consisting of only the first to third images of the kanji characters "Yu" or "Liu.""Therefore, of course, this ""non-Chinese characters"" can not be printed on this bulletin board, so in order to avoid that, we will save this ""non-Chinese characters"" as the image file ""img0001.jpg"" and so on, and then

"

(character(value Image("img0001")(width1000)(height1000)…(omitted below)

It was defined as follows:However, the conversion candidate will only display the first and second letters of Image("img0001") and will not function properly.
I forgot to mention that each candidate for conversion of multiple kanji characters should display only two half-width alphanumeric characters or one full-width character.

Then I thought of letting them choose a candidate for "image" in the switch statement, but it is unclear whether this will work or not.

I still have some alternatives in my mind, but I want to finish them as simple as possible.So I am writing to ask for your advice.
The main development language of Zinnia-Tomoe itself is Objective-C, but in this question, the language should be Swift and the framework should be SwiftUI if possible.

swift xcode swiftui

2022-09-29 22:47

1 Answers

You may not understand the intent of the question, but if you know the coordinates of the kanji characters, you may be able to express them using the SwiftUI Path.

Can't you do it like this article?

SwiftUI: I created a library where I can convert SVG to SwiftUI Path and output code


2022-09-29 22:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.