These are chat archives for AvaloniaUI/Avalonia

27th
Dec 2018
Nikita Tsukanov
@kekekeks
Dec 27 2018 00:28
@Kermalis
Bind some viewmodel property to IsPointerOver
Then bind hovered color effect to the same viewmodel property
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 01:02
The other option would be to create a new style that uses the :pointerover pseudoclass.
Valters
@FaithLV
Dec 27 2018 01:22
Hey, do you think that there would be any chance getting XAML Intellisense working in VSCode?
Nikita Tsukanov
@kekekeks
Dec 27 2018 06:28
You can try continuing the work from the last year
At some poijt I gave up
Thenproblem with VSCode is that it's just a notepad that can talk to somr
"language server"
Which causes a complete lack of integration between said language servers
So we can't access any project system information from vscode plugin
Since it's stored in OmniSharp
So the only way to get required info is to manually parse solution file and call msbuild
Nikita Tsukanov
@kekekeks
Dec 27 2018 06:33
I've got to the point where I could show a previewer for a particular xaml file in browser via self-hosted asp.net app and websockets
But that still needs integration with vscode
Also, the actual language server implementation is needed
Then we'll have to somehow ship c# part with vscode extension
With a build for each platform
I was thinking about shipping the language server as nuget package, so we could use some simple csproj wrapper
Benedikt Schroeder
@Gillibald
Dec 27 2018 15:02
Looks like at some point I have to introduce our own HarfBuzz C# binding. Using SharpGenTools would be ideal. The current state of HarfBuzzSharp(SkiaSharp) is just rudimentary and doesn't have to be tied to SkiaSharp at all.
Benedikt Schroeder
@Gillibald
Dec 27 2018 15:07
On top of HarfBuzz we need some library that does BiDi, script recognition etc
We should use existing libraries that are already used by major applications like Chrome, Firefox etc
Nikita Tsukanov
@kekekeks
Dec 27 2018 15:46

Looks like at some point I have to introduce our own HarfBuzz C# binding

I think it would be better to send patches to upstream

BTW, since C++/CLI would be available for .NET Core
Matthew Leibowitz
@mattleibow_twitter
Dec 27 2018 15:47
@Gillibald @kekekeks to do BiDi, you would use ICU in conjunction with harfbuzz
ICU does the main work with text processing, and then harfbuzz takes the snippets and gives you the codepoints and positioning
Nikita Tsukanov
@kekekeks
Dec 27 2018 15:48
We might want to try to use it in /puremode that allows to produce pure MSIL
libICU is WAY too huge
Matthew Leibowitz
@mattleibow_twitter
Dec 27 2018 15:49
yeah, but there are ways to split out the data
should be 5MB with the common things
I have been wanting to do this for a long time for skiasharp
I was also having a look at what flutter does - they have another engine for text
  • i forgot the name
braca
@braca
Dec 27 2018 15:51
How can I change an <Image source using a style?
<Style Selector="Image.someClass">
    <Setter Property="Source" Value="avares://TestApp/Assets/image.png" />
  </Style>
something like that
Benedikt Schroeder
@Gillibald
Dec 27 2018 15:54
https://github.com/sillsdev/icu-dotnet but doesn't seem to have all what we need
Nikita Tsukanov
@kekekeks
Dec 27 2018 16:00
@mattleibow_twitter minikin?
Seems to be handling bidi
Would be nice to somehow transform it to managed code
Benedikt Schroeder
@Gillibald
Dec 27 2018 16:12
They use ICU and HB so the needed dependencies are the same
Benedikt Schroeder
@Gillibald
Dec 27 2018 16:25
We can't avoid HarfBuzz.To be able to split a sequence of characters into groups of the same script and direction ICU could be used. Advanced text breaking could also be performed by ICU but isn't mandatory in the early stages. Maintaining our own implementation of low level processing wouldn't be ideal. This is just too complex in my opinion.
Matthew Leibowitz
@mattleibow_twitter
Dec 27 2018 18:47
that is basically what I was able to determine also. i do not want to be responsible of maintaining and real code in this area as i will probably murder the whole thing with my english-only knowledge
Nikita Tsukanov
@kekekeks
Dec 27 2018 18:56
All that considered, icu is 35MB monstrousity
If we could somehow make it ~1MB, then it should be ok to add that dependency
I think .NET Core depends on icu on Linux
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 18:58
C++/CLI is staying Windows only
Nikita Tsukanov
@kekekeks
Dec 27 2018 18:58
Where it's shipped with the system
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 18:59
And icu is depended on by net core on Linix
Nikita Tsukanov
@kekekeks
Dec 27 2018 18:59
@jkoritzinsky C++/CLI has pure CLI mode
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 18:59
*Linux
That is true and that would work.
Nikita Tsukanov
@kekekeks
Dec 27 2018 18:59
Which produces a portable CIL image
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 18:59
But it would only build on Windows
Since that's the only place the tool chain is available
Nikita Tsukanov
@kekekeks
Dec 27 2018 19:00
That's fine as long as we keep C++ code in a separate repo and consume it as nuget library
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 19:00
And the C++ team might be depreciating that option soon iirc
*deprecating
Nikita Tsukanov
@kekekeks
Dec 27 2018 19:01
I think we wont need anything ither than netstandard2.0 for our C++ dependencies
So it shoukd be fine to use outdated toolchain binaries
It would be really nice to have msil backend for clang
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 19:02
So there's a few tool chain problems: clr:pure isn't supported in VS 2017 and newer. And the current tool chains don't support net core. They directly load the net framework runtime native dlls
Nikita Tsukanov
@kekekeks
Dec 27 2018 19:03
That's unfortunate
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 19:05
Yeah. These tool chain issues are the engineering reasons the net core version of WPF isnt fully open source yet.
I think we could compile C to WASM
And then convert WASM to msil
That would require data marshalling
Since WASM has its own linear memory
And is limited to 32bit address space, I think
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 19:18
Why not just use P/Invokes or SharpGenTools or Cppsharp? Why all of this roundabout conversions?
*these
Nikita Tsukanov
@kekekeks
Dec 27 2018 19:24
Why? The need to compile the native binary for 10+ different targets
Win32/64, OSX, Linux (x86_64 and ARM, more archs if we consider Mono), Android (i386, x86_64, arm, arm64, mips), iOS, WinPhone (again, several processor architectures)
WinPhone is now called UWP, I've forgotten
Still a different target
Nikita Tsukanov
@kekekeks
Dec 27 2018 19:30
Since we would be the only consumer of such native binaries
It would a pain to setup and maintain
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 19:43
If we need a native component we already have to maintain all of those. Unless you're saying that we should build HarfBuzz or libicu into CIL?
And if we're doing linking to non-C-style libraries ABIs, we'll have to deal with different name manglings and layouts anyway.
Nikita Tsukanov
@kekekeks
Dec 27 2018 20:22
Would be really nice to compile them into CIL, yes
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 20:30
Then what about the platform-specific code in each library? Or the native libraries they link to? I just don't see that working out well.
And with Azure DevOps it isn't that bad to get platform-specific packages built.
Matthew Leibowitz
@mattleibow_twitter
Dec 27 2018 21:02
I build skia and harfbuzz for ios, android, watchos, tvos, uwp, win32, linux, macos and it is mostly ok
my script is bigger because i do extra steps because we have custom code
harfbuzz is just a cmake now, so that should make things easier
Benedikt Schroeder
@Gillibald
Dec 27 2018 21:14
I could add the needed bits to HarfBuzzSharp and everything is working as expected. Will send in a PR soon. Probably the best for now to implement the missing parts myself.
Matthew Leibowitz
@mattleibow_twitter
Dec 27 2018 21:17
please do, harfbuzzsharp was just really for testing something and probably not too useful for most
most people just want a draw this string with this font in this box. it is currently a stopgap for drawing persian, hebre and japanese text
add what you need and we can get that in
Jeremy Koritzinsky
@jkoritzinsky
Dec 27 2018 21:20
👍