These are chat archives for AvaloniaUI/Avalonia

6th
Aug 2017
Jeremy Koritzinsky
@jkoritzinsky
Aug 06 2017 03:53
@grokys @danwalmsley I just put out a PR to update our RxUI library to use the new NuGet package of theirs that doesn't have any WPF dependencies and remove the submodule.
Nikita Tsukanov
@kekekeks
Aug 06 2017 07:04
@jkoritzinsky have you checked that it works with Mono+Linux/OSX?
reactiveui/ReactiveUI@e6979f6
Oh
that's really nice
Jeremy Koritzinsky
@jkoritzinsky
Aug 06 2017 07:11
Yeah I took the initiative to push this through on ReactiveUI so we could update it.
I can add those if you want. We have to kind of hook into their system from the outside though but we can make it work.
Nikita Tsukanov
@kekekeks
Aug 06 2017 07:15
That can be done later, I think
Since now it's mostly working with just scheduler

We have to kind of hook into their system from the outside though but we can make it work

I'm looking into the code right now and I think that they are using Splat's Locator.CurrentMutable

That is done in RxApp's static constructor
So we can safely assume that we can just register stuff there directly
That will make us depend on particular RxUI version, but what you gonna do
Nikita Tsukanov
@kekekeks
Aug 06 2017 07:20
We could provide an overload that accepts alternative registerFunction
Steven Kirk
@grokys
Aug 06 2017 09:05
@jkoritzinsky just saw your rxui PR - that's awesome. i made a start a few times on that myself and gave up
danwalmsley
@danwalmsley
Aug 06 2017 12:13
@grokys when are you planning next release?
Steven Kirk
@grokys
Aug 06 2017 12:17
not sure - i guess after netstandard2.0 comes out?
danwalmsley
@danwalmsley
Aug 06 2017 12:19
makes sense
I'm hoping we can get a font api in for next release
If someone can give me an idea of whats required, I can probably tackle it
for embedding fonts, etc
Steven Kirk
@grokys
Aug 06 2017 12:46
i'd start off my looking at the font api in other frameworks: wpf, uwp, html
danwalmsley
@danwalmsley
Aug 06 2017 14:14
Uwp looks like this

To view the custom font in your control set the font properties of your control like the following code. Here I am going to use textblock to show custom fonts:

<TextBlock Text="Suresh C# Corner MVP"TextAlignment="Center"VerticalAlignment="Center"FontFamily="Assets/Swiftel.ttf#Swiftel Base DEMO"></TextBlock>
You can set the font family proprieties in code behind also like the following code.

textBlock.FontFamily = newFontFamily("/ Assets / Swiftel.ttf#Swiftel Base DEMO");
Sometimes you will face issues while displaying custom font in design view works normally, but in emulator the default font is displayed for that so follow the solutions below

danwalmsley
@danwalmsley
Aug 06 2017 14:36
I think it would be nicer if somewhere you could declare <Font Path="Assets/Consolas.ttf#Consolas" Name="Consolas" />
Somewhere like in app.xaml
Then anywhere else just do fontfamily=consolas
So font adds it to a global cache
And we can a cacheimpl for each back end
We could also support Uwp syntax to directly pull from embedded resource
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 17:32
@grokys StyleInclude seems to be broken when using inside UserControl it worked before
It works only first time control is loaded after that style resources are not avaiable
when I include style directly it all works
Steven Kirk
@grokys
Aug 06 2017 18:01
hmm, sounds like another portable.xaml thing
could you add an issue?
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 18:07
@grokys AvaloniaUI/Avalonia#1088
hopefully this AvaloniaUI/Avalonia#492 issue can also be fixed :smile:
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 18:25
@grokys Great-work on scene-graph https://youtu.be/SAVUDnajMV4
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 18:50
@grokys
2017-08-06_20-50-01.gif
This is possible source of artifacts
Lines are not always included in dirty rectangles
AvaloniaUI/Avalonia#1089
Steven Kirk
@grokys
Aug 06 2017 19:16
Ah really? Ok that's interesting
#492 really needs fixing, is the biggest big still left
I've tried a few times, but it's not straightforward unfortunately
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 19:32
@grokys I think something is wrong with DrawLine it in some cases does not draw lines at all
Ok so when my custom control (derived from Canvas) does not have Background set line drawing is failing
when I set Background="Transparent" or other color line drawing is working as excepted
but each time entire Canvas control is marked as dirty
Steven Kirk
@grokys
Aug 06 2017 20:09
hmm ok
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 20:18
@grokys I have found repro for #1089
Steven Kirk
@grokys
Aug 06 2017 20:21
oh cool! was just trying to repro the line not drawing when the canvas background isn't set (couldn't repro it)
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 20:21
its tricky to find this repro :fire:
Steven Kirk
@grokys
Aug 06 2017 20:22
yeah, your repro works - that's saved me a lot of time, thanks ;)
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 20:22
np
Steven Kirk
@grokys
Aug 06 2017 20:51
@wieslawsoltes ok, AvaloniaUI/Avalonia#1090 should fix it!
was a simple fix
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 21:14
@grokys Its fixed!
Steven Kirk
@grokys
Aug 06 2017 21:27
yay! do you still get the artifacts when zooming?
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 21:27
yes
Steven Kirk
@grokys
Aug 06 2017 21:28
merged that PR - ok will take a look at zooming next
Wiesław Šoltés
@wieslawsoltes
Aug 06 2017 21:28
ok
to repro the issue
Steven Kirk
@grokys
Aug 06 2017 21:33
oh cool, thanks!
Nikita Tsukanov
@kekekeks
Aug 06 2017 21:57

@danwalmsley

If someone can give me an idea of whats required, I can probably tackle it

I'd recommend to take a look at SkTypeface class

It has pretty good API
Jeremy Koritzinsky
@jkoritzinsky
Aug 06 2017 22:12
Definitely don't base the API off DirectX's. That one is pretty bad.