Skip to content
This repository was archived by the owner on May 28, 2022. It is now read-only.

non monospace fonts #2

Open
eporral1 opened this issue Jan 31, 2017 · 4 comments
Open

non monospace fonts #2

eporral1 opened this issue Jan 31, 2017 · 4 comments

Comments

@eporral1
Copy link

Hi, thank you for this package, it saved me a lot of work :)

Is it possible to make it work with non mono-space fonts ?
Using a non mono-space font (with a ui text inside a layout) makes the emojis position incorrect

I had to change the following line

TextGenerator textGen = textToEdit.cachedTextGenerator;

to

TextGenerator textGen = textToEdit.cachedTextGeneratorForLayout;

Here is an example

image

Thanks!

@mcraiha
Copy link
Owner

mcraiha commented Jan 31, 2017

I did not test this with layouts. So if the layouts alter the positioning of characters then the Vector3 imagePos... part will be calculated incorrectly and emoji positions will be wrong.

@eporral1
Copy link
Author

Hi, thank you for your reply!!!
I have the same issue without layouts, but using a non monospace font

image

It seems there are missing spaces, how can I fix this ?

Thank you!

@mcraiha
Copy link
Owner

mcraiha commented Jan 31, 2017

Check that your font has em quad character (U+2001). And if it is there then check that it is actually occupies square area.

@eporral1
Copy link
Author

Hi @mcraiha , I've just realized that I had a wrong pivot x:

Pivot X 0.8
Pivot Y 1.6

I changed Pivot X to 1.6 and got it to work, even with layouts !!

Thank you so much for your help!

Esteban

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants