-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text wrapping does not work properly for accented characters #135
Comments
@prepare Probably a bug of Typography.TextBreak. |
Confirmed a bug of Typography.TextBreak. |
This Typography bug was fixed, |
@prepare Thanks a lot! |
Still need to fix this for diacritics via LaTeX commands instead of Unicode, i.e. |
You should provide your own font like in #142. |
@BenjaNapo See #20. |
I wrote in the constructor of App.cs: but it says that GlobalTypefaces is an onlyread attribute |
For GlobalTypefaces, you call |
App.xaml
App.cs
Sorry but I never imported Font from code, where did I go wrong? |
Are you trying to override the font? The default is |
Changed with:
But 3rd line throws ArgumentNullException, I think that the problem is in reading font file in this way |
The null means that |
Now it loads the font from the stream but crash on the 4th line (Typeface t = ...) throwing this exception: |
Try following https://github.com/verybadcat/CSharpMath#sourcelink-for-ci-packages and debug into the source of Typography. |
@BenjaNapo Or you can upload a zipped file containing your file and let me investigate what changes are needed from Typography's side. |
This bug's fix depends on a decision on updating Typography in LayoutFarm/Typography#192.
|
https://drive.google.com/file/d/1zlvyQ2XXvb0fQJ8k-otYZ4hiR_8L3H-d/view?usp=sharing Here you are, with this you could note all the issues that I had 'til now (text alignment, change font and height of textview) Thanks for all the help ^^ Hope this will contribute with the evolution of the library |
@BenjaNapo #144 should fix "text alignment" and "height of textview". This leaves "change font" as to-do.
Thank you for taking the time to report problems too! |
@BenjaNapo I can't download the file. I have requested access. |
Ow, sorry, thought that just the link will work. Does it work now? |
Works now, thanks |
@BenjaNapo I'm not getting the |
What is the stack trace? |
I mean the stack trace of the exception. |
Ehm... How can I ? |
@Happypig375 Should this be working in the latest preview NuGet package (0.5.0-alpha4) or is it not yet released? |
Yes, the fix should be included in 0.5.0-alpha4. |
@Happypig375 It seems it does not work for me 🤔 : For example on the last line of the text is the word "světovou" broken as "svě" and "tovou". Was the Typography module bumped to the updated version? @prepare do you have some idea what could be wrong? |
Ohhh. Yea I misrecognized this issue as the ones that were fixed. Yes this depends on updating Typography currently, but I am looking to refactor to reuse the math parser for text, so the Typography.TextBreak dependency will be gone by then. This is targeted at 0.5.0-beta. |
In the end I resolved in this way:
|
Oh... Maybe the stream returned by |
Yep, indeed the NotSupportedException was in Length/Position attributes 😅 I think that now we can close the issue (?) |
This is tracked here: #142 However it will be a few weeks before I can work on this. |
Hi @Happypig375, regarding the line break fix for words with accented characters, is there an estimate when a preview package with this could be released please :-) ? |
@MartinZikmund I don't have the capacity to put in work in the near future. It's really best to just fork and submit a PR for now. |
@Happypig375 of course, understood 👍. Just to check - is there something missing on the text wrapping code-wise or is it just about releasing a new package? I thought @prepare adjusted the line breaks in Typography, which should transitively fix the problem for CSharpMath, if we update to that version. |
See #107 (comment). |
@MartinZikmund I said I would do the font work but am not using TextPainter any more. I don't think I have time to progress with this by myself in the very near future but can collaborate with you on a PR. Weekends best. |
Describe the bug
Text wrapping does not properly work for accented characters like ěščřžýáíé.
To Reproduce
Expected behavior
Words with accented characters should not be broken between lines.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: