These are chat archives for AvaloniaUI/Avalonia

7th
Nov 2017
AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 11:40
@kekekeks I see in your code that DrawGlyphRun (and also GlyphRun) is implemented
Why don't add glyphs?
;)
Nikita Tsukanov
@kekekeks
Nov 07 2017 11:47

DrawGlyphRun (and also GlyphRun) is implemented

Ehm, where?

AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 11:51
in the class AvaloniaTextRenderer
namespace Avalonia.Direct2D1.Media
Nikita Tsukanov
@kekekeks
Nov 07 2017 11:51
That's platform backend code
it works only on win32
AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 11:53
I work on win32 :)
Nikita Tsukanov
@kekekeks
Nov 07 2017 11:54
You can use Direct2D directly then
AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 12:00
that means I should create this class in my application... :(
danwalmsley
@danwalmsley
Nov 07 2017 12:02
@AlessandroMiorelli can you give us an idea what you are looking to achieve?
AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 13:13
I wrote an application for TV graphic, a character generator
I used WPF, XAML and c#
It works fine
the problem occurs on 1080p 50Hz
if I have a lot of objects and animation the rendering time could be greather than 20ms
and drop some frame or could be slow
I'm searching something to render faster than standard WPF
the problem is that I need alpha channel for transparency
avaloniaUi seems to be my case
AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 13:18
but I have to switch some standard controls in avalonia controls
Nikita Tsukanov
@kekekeks
Nov 07 2017 13:19
You can try using FormattedText instead of Glyph (which is an overkill but should work) or use Direct2D directly
AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 13:21
ok, thank you. I will try
to use Direct2d directly
danwalmsley
@danwalmsley
Nov 07 2017 14:24
@AlessandroMiorelli why cant you just use textblock?
is it performance?
AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 15:01
this is one reason. the other reason is not so easy to explain.. I try. The sw works with times. the times are aligned to the right. so if I display "12:34:56.78" and after that "12:34:56. " the dot on right should be at the same position on video
glyphs help me because I set the position of each chars
Nikita Tsukanov
@kekekeks
Nov 07 2017 15:04
use monospaced fonts with spaces
AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 15:06
the problem is that the width of space ' ' is not the width of the number
monospaced fonts are not so good to show
rconde01
@rconde01
Nov 07 2017 15:06
are the fonts fixed size?
If so...just render the characters to images...it's only 12 (0-9,:,.)
danwalmsley
@danwalmsley
Nov 07 2017 15:21
A "workaround" might be to use a separate Textblock for each digit ?
and you can have a fixed width?
and position them individually and use any font you like
since its only a few digits it will probably work?
AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 15:49
thank you, but not so good
danwalmsley
@danwalmsley
Nov 07 2017 17:36
You could write a custom.control that renders formatted text with correct spacing?
AlessandroMiorelli
@AlessandroMiorelli
Nov 07 2017 18:48
I think I will create my own control that use GlyphRun of Direct2D
maybe I will use the code of standard Glyphs like example