iink SDK on Device

Answered

GetStarted does not show variables

Hi, 

I start working with your GetStart example with the version 2.0. If I am working with the math part the screen does not show variables only numeric numbers and the operations. But in this line 

try self.editor?.export(selection: nil, mimeType: .laTeX)

the sdk shows me that it does recognize variables. For example, if I write "2x" only the number 2 is shown but "x" not but the export with LaTex gives me 2x. So is there a configuration how to display variables ? 

 


Best Answer

Dear Thanh Hoang,


thank you for contacting us.


Currently, based on the above, you did not precise it but I guess you changed the default font?


Indeed, it is likely the font you set is not embedded into your project.


You shall then proceed as we do in our Demo sample:

-In your project, create a “Resources/Fonts” directory, in which you add the fonts you need
-Add a theme.css file, in which you can set your default theme (if using our default UIReferenceImplementation, it will be set by default):
private func initEditor(with target: DisplayViewModel) {
guard let engine = self.engine,


// Apply theme from css file if any
if let path = Bundle.main.path(forResource: "theme", ofType: "css"),
let cssString = try? String(contentsOfFile: path).trimmingCharacters(in: .whitespacesAndNewlines) {
try? self.editor?.set(theme: cssString)
}


From a more global perspective, we recommend you rather refer to our latest iOS Demo sample to develop your own application.

Let us know if this helps.

Best regards,

Olivier

1 Comment

Answer

Dear Thanh Hoang,


thank you for contacting us.


Currently, based on the above, you did not precise it but I guess you changed the default font?


Indeed, it is likely the font you set is not embedded into your project.


You shall then proceed as we do in our Demo sample:

-In your project, create a “Resources/Fonts” directory, in which you add the fonts you need
-Add a theme.css file, in which you can set your default theme (if using our default UIReferenceImplementation, it will be set by default):
private func initEditor(with target: DisplayViewModel) {
guard let engine = self.engine,


// Apply theme from css file if any
if let path = Bundle.main.path(forResource: "theme", ofType: "css"),
let cssString = try? String(contentsOfFile: path).trimmingCharacters(in: .whitespacesAndNewlines) {
try? self.editor?.set(theme: cssString)
}


From a more global perspective, we recommend you rather refer to our latest iOS Demo sample to develop your own application.

Let us know if this helps.

Best regards,

Olivier