Open Aqoolare opened 3 years ago
Thank you very much for your prompt answer, but I am having problems using the given solution. But I have some problems with its application, I attach screenshots with errors. And also I have a question, where should this code be placed in the project?
@Aqoolare The change is not published yet, I'll publish a 0.5.1 and you can use that code.
Also to use C# 9 which I've used, you must add <LangVersion>latest</LangVersion>
to the <PropertyGroup>
inside your .csproj
.
Ok, thanks a lot for the help. And I have one more question, is there any way to add horizontal scrolling to a textview if its content doesn't fit on the page? in this case the content is enclosed in $$ .. $$
Yes, it really works, thanks but my other textviews, which were aligned to the width of the screen, also stretched, so I need to add a separate textview, for the $$ .. $$ cases?
You can also add your own line breaks with \\
or reduce the font size.
Ok, thank you very much for such prompt support.
but my other textviews, which were aligned to the width of the screen, also stretched, so I need to add a separate textview, for the $$ .. $$ cases?
That's one option. You can also measure the minimum width to control the layout. E.g.:
Thanks for the advice, but I'm new to Xamarin app development, could you give me a small example if it's not difficult for you?
How can i refer in xaml code to parameters of another object? I don't understand, how to scale FontSize based on the width
I have FontSize=43, HeightRequest is fixed for each TextView, and i have different results on different devices
I think it's related to screen density differences? You could try dividing or multiplying with https://docs.microsoft.com/en-us/xamarin/essentials/device-display?tabs=android#main-display-info.
Also, I installed new version, but the contents are gone
I think it's related to screen density differences? You could try dividing or multiplying with https://docs.microsoft.com/en-us/xamarin/essentials/device-display?tabs=android#main-display-info.
Ok, thank you, i'll try it
@Aqoolare Try InvalidateSurface()
on the TextView?
I think it's related to screen density differences? You could try dividing or multiplying with https://docs.microsoft.com/en-us/xamarin/essentials/device-display?tabs=android#main-display-info.
Can you give some advice about formula? I tried this but it didn’t work in full, the text in places crawls out of the screen horizontally and vertically, in the case of vertical maybe I should increase the height of the textview too, but I can’t think of a suitable formula
@Aqoolare Try
InvalidateSurface()
on the TextView?
I use this in data binding and don't know how to call this method It looks like this
I'm sorry for asking so many stupid questions, but I really need to figure this out.
Use https://docs.microsoft.com/en-us/dotnet/desktop/xaml-services/xname-directive to get the view.
Guys, I found how to solve the display problem! I used the wrapper this way public class MyTextView : TextView { public MyTextView() { InvalidateSurface(); } }
And used it on xaml this way <views:MyTextView x:Name="textView" LaTeX="{Binding Formula}" Margin="15, 5" FontSize="43"/>
But issue with the words wrapping remains
Maybe I don't understand where to put this code CSharpMath.Rendering.Text.TextLaTeXParser.AdditionalBreakingEngines.Add(new RussianBreakingEngine());
This thread is getting overloaded with different issues so I've hidden everything not related to line breaks. Please post other issues if you have unresolved questions not relating to line breaks @Aqoolare . Thanks.
Currently CSharpMath uses Typography.TextBreak, so one option is to wait for Typography.TextBreak to resolve the issue that @Happypig375 posted.
I'm not convinced that text breaking is difficult enough to require a separate engine. Can't we break on spaces and hyphens only? LaTeX doesn't usually support automatic hyphenation and I assume we have no plan to support that, so breaking should be easy shouldn't it?
Overleaf breaks on spaces and commas but not punctuation:
This thread is getting overloaded with different issues so I've hidden everything not related to line breaks. Please post other issues if you have unresolved questions not relating to line breaks @Aqoolare . Thanks.
Currently CSharpMath uses Typography.TextBreak, so one option is to wait for Typography.TextBreak to resolve the issue that @Happypig375 posted.
I'm not convinced that text breaking is difficult enough to require a separate engine. Can't we break on spaces only? LaTeX doesn't usually support hyphenation and I assume we have no plan to support that, so breaking should be easy shouldn't it?
My other problems have been resolved, thanks, the only thing I would like to clarify, that is, at the moment the transfer by Russian words does not work?
Even with this code 'CSharpMath.Rendering.Text.TextLaTeXParser.AdditionalBreakingEngines.Add(new RussianBreakingEngine());'?
Describe the bug
Line break does not work when using the Russian language.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Words are wrapped to a new line at the end of a word
Environment (please complete the following information):
Additional context
I really need to solve this problem :(