These are chat archives for AvaloniaUI/Avalonia

10th
Jun 2018
Jumar Macato
@jmacato
Jun 10 2018 00:26
@nc4rrillo @Gillibald regarding unicode, is it possible to have a system font fallback for unicode characters that is not supported by the user-set FontFamily?
if that's possible then i think that would help in making those ugly glyph boxes not be as visible as often
Nelson Carrillo
@nc4rrillo
Jun 10 2018 00:34
Totally possible
There should be a list of fallback fonts that get tried until a matching glyph is found
Jumar Macato
@jmacato
Jun 10 2018 00:35
Alright :smile:
Benedikt Schroeder
@Gillibald
Jun 10 2018 06:20
Harfbuzz does exactly that when glyph runs are processed. Have to figure out how to use it properly. I wonder how skia can handle color fonts with DirectWrite. Even computing the outline of a glyph run myself produces bad quality results. Reduce the stroke width to 0.5 helps a bit. This is really frustrating.
Jumar Macato
@jmacato
Jun 10 2018 06:27
i think Typography does Text shaping iirc
ahopper
@ahopper
Jun 10 2018 06:41
@jkoritzinsky replacing sprache looks like a good move, it came up as a hotspot in profiling AvaloniaUI/Avalonia#1529
Jumar Macato
@jmacato
Jun 10 2018 06:41
ah yeah that reminds me
@wieslawsoltes take a look at #1668 :smile:
Wiesław Šoltés
@wieslawsoltes
Jun 10 2018 06:52
Seems like big performance improvement
Jumar Macato
@jmacato
Jun 10 2018 06:52
yes :D
Wiesław Šoltés
@wieslawsoltes
Jun 10 2018 07:11
I have a lots of bindings in Core2D, this may have big impact :smile:
Nelson Carrillo
@nc4rrillo
Jun 10 2018 07:38
I don't think Skia uses Dwrite to actually draw the text
Ah they use CreateAlphaTexture and blit it themselves
Jumar Macato
@jmacato
Jun 10 2018 07:57
@wieslawsoltes please review the PR later when you have Core2D perf findings :")
Wiesław Šoltés
@wieslawsoltes
Jun 10 2018 08:14
Yeah it would be nice to have some benchmarks for that in Core2D
Wiesław Šoltés
@wieslawsoltes
Jun 10 2018 08:37
@jkoritzinsky do you think it would be possible to use your benchmarks from AvaloniaUI/Avalonia#1668 with Core2D ?
danwalmsley
@danwalmsley
Jun 10 2018 10:34
hmmm just noticing these warnings..
AvalonStudio Warning: 0 : Binding: Error in binding to "Avalonia.Controls.Presenters.ContentPresenter"."VerticalContentAlignment": "Could not find CLR property 'VerticalContentAlignment' on 'Avalonia.Controls.TreeViewItem'"
AvalonStudio Warning: 0 : Binding: Error in binding to "Avalonia.Controls.Presenters.ContentPresenter"."HorizontalContentAlignment": "Could not find CLR property 'HorizontalContentAlignment' on 'Avalonia.Controls.TreeViewItem'"
but TreeViewItem should have that property
danwalmsley
@danwalmsley
Jun 10 2018 10:43
@jmacato could you review #1669?
Jumar Macato
@jmacato
Jun 10 2018 10:44
sure
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 13:32
@wieslawsoltes I can try. I'm not the best with BenchmarkDotNet.
Wiesław Šoltés
@wieslawsoltes
Jun 10 2018 13:33
Yeah me too.
But more so with unit testing Avalonia apps
It would be nice to have infrastructure to test App.cs with BenchmarkDotNet
and available via NuGet :smile:
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 13:35
I feel like BenchmarkDotNet is more for microbenchmarks though tbh.
At least the timing features aren't super useful for UIs.
Wiesław Šoltés
@wieslawsoltes
Jun 10 2018 13:36
but xaml loading and instantiation should be testable
without the rendering part
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 14:09
Yeah.
ahopper
@ahopper
Jun 10 2018 15:42
Has anyone made WrapPanel work inside a ListBox or something similar, just trying to display a scrollable grid of icons and take advantage of virtualization
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 15:50
I don't know if you can put a wrap panel in a visualized container. Virtualization tells it's children that there is infinite size available. So wrap panel wouldn't know where to wrap.
ahopper
@ahopper
Jun 10 2018 15:53
Yep I tried fixing the width which allows it to work in a scroll viewer but no joy in ListBox
the wpf UniformGrid is probably what I want
Steven Kirk
@grokys
Jun 10 2018 16:05
we'd need to write a VirtualizingWrapPanelor something
at the moment we only have VirtualizingStackPanel
Wiesław Šoltés
@wieslawsoltes
Jun 10 2018 16:09
Did you try using stack panel with horizontal orientation
ahopper
@ahopper
Jun 10 2018 16:12
won't that just give me one line?
fixing the width of the wrappanel does make it display but it is not virtualized.
@grokys thanks, another little weekend task :)
Steven Kirk
@grokys
Jun 10 2018 16:17
hehe cool. but yeah it might actually be a bit difficult if the items aren't fixed size, so a VirtualizingUniformGrid might be easier
ahopper
@ahopper
Jun 10 2018 16:27
just tweaked https://github.com/ahopper/Avalonia.IconPacks so you can build up a set of icon resources by clicking on icons
Splitwirez
@Splitwirez
Jun 10 2018 17:45
Is it possible to incorporate Avalonia stuff into an existing Class library?
Splitwirez
@Splitwirez
Jun 10 2018 17:50
(or even use it in a new one, for that matter)
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:01
Yeah it should be possible. I don't see why not.
Splitwirez
@Splitwirez
Jun 10 2018 18:02
...how would one add the Avalonia DLLs, though? (I'm going off the assumption that what I tried was wrong...)
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:03
Just add the nuget package
Same way as an Avalonia app. You will have to set up the UI thread on its own thread though and that can be really tricky to get right.
Splitwirez
@Splitwirez
Jun 10 2018 18:04
...so it's not like WPF where you can just create a Window in a DLL, then reference that DLL in another application or DLL and expect it to just work...?
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:05
Not quite. Because of the pluggable nature of Avalonia, you need to use AppBuilder to configure it. Then when you start the app, the UI thread event loop takes over until the Avalonia portion of the app is closed.
Splitwirez
@Splitwirez
Jun 10 2018 18:05
...oh
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:06
So, at least when actually starting the Avalonia app, you need to make sure to put it on its own thread. Then everything should work fine.
Splitwirez
@Splitwirez
Jun 10 2018 18:09
Alright...
...although I haven't even been able to add the Avalonia stuff from NuGet without ending up with a pile of conflicting dependencies which prevent me from building the thing...
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:15
What issues have you had?
I'm currently working on cleaning up our packaging script so any issues would be good to know.
Splitwirez
@Splitwirez
Jun 10 2018 18:16
Oh, then...hold on a second, I'll get the exact issue. (I was doing so regardless, but got distracted while waiting for the Solution to open, lol)

Could not copy the file "C:\Users\Splitwirez\Documents\Important\Start9\AvaloniaTest\Start9.Api\SkiaSharp\1.57.1\runtimes\osx\native\libSkiaSharp.dylib" because it was not found.

Could not copy the file "C:\Users\Splitwirez\Documents\Important\Start9\AvaloniaTest\Start9.Api\SkiaSharp\1.57.1\build\net45\SkiaSharp.dll.config" because it was not found.

Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:24
I think that's an issue with the Avalonia.Skia.Linux.Natives package.
Splitwirez @Splitwirez wonders whether or not the fact that he's building on Windows is of any relevance
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:26
Being on windows might be part of the issue.
Make sure you have version 1.57.1 of SkiaSharp installed/in your Nuget package cache
Splitwirez
@Splitwirez
Jun 10 2018 18:26
Exactly, or atleast?
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:26
Exactly
That package is maintained by @kekekeks so he should be able to help more than I can if we can't figure out the problem
Splitwirez
@Splitwirez
Jun 10 2018 18:28
...oh
Yeah, I have SkiaSharp 1.57.1 ...
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:29
Do the paths above exist?
Wait... I have an diea
*idea
Splitwirez
@Splitwirez
Jun 10 2018 18:29
They don't
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:29
give me one sec.
Splitwirez
@Splitwirez
Jun 10 2018 18:29
...oh?
o ok
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:30
Can you find the Avalonia.Skia.Linux.Native.targets file on your machine?
Splitwirez
@Splitwirez
Jun 10 2018 18:30
Uhhhhhhhh...where am I looking?
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:30
It should be in your package cache, but I think it might be somewhere else (or its buggy)
Splitwirez
@Splitwirez
Jun 10 2018 18:31
Found it
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:32
What's the path to it
Splitwirez
@Splitwirez
Jun 10 2018 18:32
C:\Users\Splitwirez\Documents\Important\Start9\AvaloniaTest\Start9.Api\packages\Avalonia.Skia.Linux.Natives.1.57.1.3\build\net45\Avalonia.Skia.Linux.Natives.targets
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:33
What are you using to restore packages?
Splitwirez
@Splitwirez
Jun 10 2018 18:33
?
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:33
What format are you using to reference packages? packages.config/ project.json/ PackageReference tag?
Because if you use packages.config I just found the bug.
Splitwirez
@Splitwirez
Jun 10 2018 18:34
If by that you're asking if packages.config even exists, then yeah, that's what I'm using...I guess...?
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:36
In the last few versions of NuGet there have been multiple ways to reference packages. There's the old packages.config way. There was the project.json way in DNX/.NET Core 1.0. The newest way (and the way that the Avalonia.Skia.Linux.Natives package expects) is via <PackageReference> tags in the MSBuild project files.
Looks like you're still using the old packages.config way.
Splitwirez
@Splitwirez
Jun 10 2018 18:36
I...guess so...
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:36
And that package isn't built to support it.
Splitwirez
@Splitwirez
Jun 10 2018 18:36
So does that mean the issue is on my end?
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:36
No its on our end, but there's no good way for you to work around it rn
I'm guessing you're running on .NET Framework?
Splitwirez
@Splitwirez
Jun 10 2018 18:37
Yes, although I haven't a clue whether we'll remain on .NET or not...
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:38
I'll see if I can get a hold of @kekekeks and see if we can get a more maintainable method of updating that package, especially since he's really busy rn.
Splitwirez
@Splitwirez
Jun 10 2018 18:38
o ok
So...for the moment, am I just SOL?
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:38
Unless you update all of your package references in the project to use <PackageReference> tags. Which you should probably do anyway if you're using VS2017 tooling. It's a much better development experience
Splitwirez
@Splitwirez
Jun 10 2018 18:39
...oh, alright then.
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:41
There should be some tooling to automate that.
@Splitwirez here's a link to the documentation for migrating: https://docs.microsoft.com/en-us/nuget/reference/migrate-packages-config-to-package-reference
Splitwirez
@Splitwirez
Jun 10 2018 18:42
Thank
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:43
No prob! Hopefully we can fix your issue soonish so we don't have to worry about this popping up again.
Splitwirez
@Splitwirez
Jun 10 2018 18:43
Best of luck in doing so :V
...tbh, getting a new Projects set up in the first place is honestly the biggest hurdle I've faced with Avalonia, everything beyond that seems like it's either capable of what we need, or atleast close.
jp2masa
@jp2masa
Jun 10 2018 18:47
if you use the new project system for all projects (except winforms, wpf, uwp, xamarin), it's much easier to create and maintain the projects
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:49
Yeah the new project system really just makes everything easier.
Splitwirez
@Splitwirez
Jun 10 2018 18:49
...?
Jeremy Koritzinsky
@jkoritzinsky
Jun 10 2018 18:49
The SDK-style projects
PackageReference is one of the features that came with them (though PackageReference still works in the old style)
Splitwirez
@Splitwirez
Jun 10 2018 18:50
Wait, the "Avalonia Application" and "Avalonia MVVM Application" things...?
jp2masa
@jp2masa
Jun 10 2018 18:50
.NET Core and .NET Standard
Splitwirez
@Splitwirez
Jun 10 2018 18:50
Oh
jp2masa
@jp2masa
Jun 10 2018 18:50
there's no template for .NET Framework
but you can target it