These are chat archives for AvaloniaUI/Avalonia

30th
Dec 2018
Kermalis
@Kermalis
Dec 30 2018 03:28
what's the equivalent of UpdateSourceTrigger?
Kermalis
@Kermalis
Dec 30 2018 03:35
better question, how do I know when something changed from the ui thread, like IsPointerOver for example
ahopper
@ahopper
Dec 30 2018 08:46
you can use styles and pseudoclasses like :pointerover for things like this. See http://avaloniaui.net/docs/styles/styles
ksigne
@ksigne
Dec 30 2018 19:16
hi everyone! started to experiment with Avalonia once again
I was missing horizontal letter spacing feature to get nice fonts
so I've added following to forked d2d:
var layout = TextLayout.QueryInterface<DWrite.TextLayout1>(); layout.SetCharacterSpacing((float)(2*typeface.HorizontalSpacing - 2), 0, 0, new DWrite.TextRange(0, Text.Length));
as far as I found there is no direct alternative of that in skia
any plans on making custom text renderers?
Nikita Tsukanov
@kekekeks
Dec 30 2018 19:18
ksigne
@ksigne
Dec 30 2018 19:19
I've looked into this, but it is different stuff
it is focused on line-height only
Nikita Tsukanov
@kekekeks
Dec 30 2018 19:20
There is no built-in layout engine in Skia
ksigne
@ksigne
Dec 30 2018 19:20
yes, I know
i mean go deeper and position glyphs manually
you can do that in skia using SKCanvas.DrawPositionedText
ahopper
@ahopper
Dec 30 2018 19:21
there was talk of implementing wpf GlyphRun which I think allows this
ksigne
@ksigne
Dec 30 2018 19:22
skia doesn't have glyphrun
so basically i'm able to set letter spacing using TextLayout1 in SharpDX
it works
but it doesn't in skia
textlayout1 doesn't work in W7 without SP1, but who cares
ahopper
@ahopper
Dec 30 2018 19:23
35% of windows users :)
sorry forgot the sp1
Nikita Tsukanov
@kekekeks
Dec 30 2018 19:24
We require platform update anyway
ksigne
@ksigne
Dec 30 2018 19:24
image.png
ksigne
@ksigne
Dec 30 2018 19:24
image.png
Nikita Tsukanov
@kekekeks
Dec 30 2018 19:24
this one
ksigne
@ksigne
Dec 30 2018 19:25
so i'm confused is there any value in exploiting platform typesetting features
instead of reimplementing them in managed code
if skia is so limited
ahopper
@ahopper
Dec 30 2018 19:27
@Gillibald mentioned GlyphRun was on his todo list for skia
ksigne
@ksigne
Dec 30 2018 19:27
there is no glyphrun in skiasharp afaik
you can do DrawPositionedText but it is not glyphrun
technically you can draw FormattedText many times which is almost same, but slower
ahopper
@ahopper
Dec 30 2018 19:28
no idea what his plan was but maybe that was it
ksigne
@ksigne
Dec 30 2018 19:28
positioning each letter separately... skia doesn't provide raw font data
ahopper
@ahopper
Dec 30 2018 19:38
ForNeVeR/wpf-math#170 effectively does just that with external font info, this is ported from wpf but it did the same there, I'm intrigued to see if it can be done in a simpler way
ksigne
@ksigne
Dec 30 2018 19:47
oh wow
some really exciting stuff there
any screenshots how it looks in Avalonia?
Benedikt Schroeder
@Gillibald
Dec 30 2018 19:50
Vertical and horizontal spacing will be no issue to implement
ksigne
@ksigne
Dec 30 2018 19:50
how would you implement horizontal spacing?
Benedikt Schroeder
@Gillibald
Dec 30 2018 19:51
Just override the fonts default line spacing. Either by a factor or a fixed value.
ksigne
@ksigne
Dec 30 2018 19:52
what do you mean on line spacing here? i speak about letter spacing
ahopper
@ahopper
Dec 30 2018 19:52
image.png
ksigne
@ksigne
Dec 30 2018 19:53
does it use ttf computer modern?
ahopper
@ahopper
Dec 30 2018 19:53
nothing clever by me here btw, I just polished a port.
Just leave a comment in that PR to request features
ksigne
@ksigne
Dec 30 2018 19:54
ah, ok
so then you use drawpositiontedtext?
Benedikt Schroeder
@Gillibald
Dec 30 2018 19:59
Yes. This will change when TextBlob is introduced
ksigne
@ksigne
Dec 30 2018 20:08
Well, then it makes sense to agree which units should horizontal spacing should be
I tend to 1 = 100%, 0 = 0% (all letters close to each other without spacing)
Benedikt Schroeder
@Gillibald
Dec 30 2018 20:31
There is still some work to do in the text layout PR. When that is ready for testing I will work on features like TextDecorations, Glyphs(GlyphRun) etc.
Kermalis
@Kermalis
Dec 30 2018 21:58
@ahopper the problem with :pointerover in styles is I don't see how I can run C# code in my class when the IsPointerOver value changes