avaloniaui / avalonia.htmlrenderer Goto Github PK
View Code? Open in Web Editor NEWAvalonia front-end for the HtmlRenderer project.
License: MIT License
Avalonia front-end for the HtmlRenderer project.
License: MIT License
It does not appear to support <span style='letter-spacing:0.8em;'>
.
This would would be a good one to add.
When reverting back to 5243b3f, the build works again.
Hi there,
The Html renderer looks great. Really impressed running the demo desktop app.
Unfortunately - I cannot get passed the below error with the Browser app. Tried multiple browsers running on Windows 10.
Uncaught SyntaxError SyntaxError: The requested module './avalonia.js' does not provide an export named 'registerAvaloniaModule'
at (program) (localhost꞉5001/main.js:2:10)
Thanks for any help!
There doesn't appear to be any support for text-transform
.
Consider adding it?
See commit which broke this: AvaloniaUI/Avalonia@b89ab8f
http=>https
Possibly two issues here. See screenshot below.
Does not parse the tag string border:medium solid blue
fully but ignores the color. However, it does parse border:medium solid;border-color:blue;
.
Correct me if I am mistaken on this, but there should be no spacing between the two borders shown in the screenshot and margin is explicitly set to 0 for both.
Linux Debian 12. Avalonia 11.
I actually have a use for the ch
length unit, but can hack around its absence. Would it be worth adding support for this?
https://meyerweb.com/eric/thoughts/2018/06/28/what-is-the-css-ch-unit/
Hello. I can't seem to be able to use both HtmlLabel and HtmlPanel on v0.10. I have tested v11 and it worked fine.
When I declare a XAML namespace for the HtmlRenderer package, only HtmlContainer is shown.
Creating a fresh project, adding the 0.10 nuget package, adding the namespace and trying to find the controls result in the following:
The code-behind also doesn't feature them:
And these are the contents of the namespace in v11, which is the expected:
First of all, I would like to thank you for this great library.
When rendering this simple HTML code
<html>
<body>
<p><b>Line 1</b><br><b>Line 2</b><br><b>Line 3</b><br><b>Line 4</b></p>
</body>
</html>
If I change the block
else if (box.Boxes[i].IsBlock)
{
followingBlock = true;
}
in the CorrectLineBreaksBlocks method of DomParser.cs to
else if (box.Boxes[i].IsBlock && !box.Boxes[i].IsBrElement)
{
followingBlock = true;
}
it works, at least for my use case.
I've cloned the repo & I'm trying to build HtmlRenderer.Demo.Avalonia.Desktop and I'm getting the following build error:
Error MSB4018 The "AvaloniaStatsTask" task failed unexpectedly.
System.IO.IOException: The semaphore timeout period has expired.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Pipes.NamedPipeClientStream.Connect(Int32 timeout)
at Avalonia.Telemetry.AvaloniaStatsTask.ConnectToPipe()
at Avalonia.Telemetry.AvaloniaStatsTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() Avalonia.HtmlRenderer C:\Users\deantric\.nuget\packages\avalonia.buildservices\0.0.12\buildTransitive\Avalonia.BuildServices.targets 9
Any tips?
I am evaluating avalonia in order to create an application that can display html generated from markdown.
It seems that the HtmlControl/Rendering is currently not usable (see AvaloniaUI/Avalonia#1493).
Are there any plans to "reintegrate" that feature?
Is it possible to render content to Avalonia Bitmap
? Original project has a HtmlRender.RenderToImage
that fulfills this purpose.
Does not support alpha in colors.
This is fine: background-color:#756575;
But this is not: background-color:#756575ff;
and no background is shown.
This is also fine: background-color:rgb(201, 76, 76)
But this is not: background-color:rgba(201, 76, 76, 0.3)
Consider adding it?
In HtmlControl.cs there is a large comment referencing HtmlLabel and HtmlPanel. There doesn't appear to be an HtmlPanel, in fact the only public class with a public constructor appears to be HtmlLabel. Is there any way to render chunk of HTML in a panel with Avalonia?
I'm looking for a cross platform equivalent to the System.Windows.(Controls|Forms).WebBrowser control - preferably one that doesn't require a Chrome process to be loaded up (which I believe is how CefGlue works, if I'm not mistaken). Avoiding the Chrome process was my primary reason for choosing Avalonia over Electron for my project.
Thanks! :)
PS - are there any implementation examples/demos or documentation for this that I can reference? thx again
PS Again - when I say "WebBrowser" equivalent I should clarify that it doesn't need to be used for anything complex. I'm essentially rendering Markdown to HTML using Markdig. So it will be some headers, bold, italic, links, etc. No crazy layout or anything.
I use the demo to set custom fonts, like this:
var f = new FontFamily(
new Uri("avares://AvaloniaPreviewApp/Assets/Fonts/CustomFont.ttf"),
"1 Smoothy DNA");
HtmlRender.AddFontFamily(f);
HtmlLabel and HtmlControl Unable to use custom font rendering, but the same code works fine in WPF
Css in the style div on the head does not respect the display flag flex, and renders nothing with the class applyed.
<style> .banner { width: 100%; height: auto; position: relative; justify-content: center; align-items: center; display: flex; } </style>[Discussion]
Overrall I think HtmlRenderer is pretty good and will be using it. Thank you for providing it!
margin:auto does not appear to be supported.
Means, for example, you can't center an image as described here:
Is it possible to update the used Avalonia version in this project? I was using the nuget package of this project (version 0.6.1), in conjunction with NetSparkle.
When trying to open an update window from the netsparkle library the following error is thrown:
When I download the source code of this project and remove the nuget package reference and change it to a project reference, everything is working fine.
For now I can workaround by using the source code of this repository, but a refreshed nuget package would come in handy.
Just say'in.
The CSS style font-weight:400;
generates bold. It would be nice if this recognised numbers.
When you place the render in a stack panel the scroll bar disappears.
Per title.
Just want to say -- this is brilliant. Just what I needed. Thank you!
Hi, I am particularly referring to the following code within HtmlLabel.cs
and there f.e. to the first else if
. Something seems to be missing there. Since Avalonia at the moment seems not to be capable of displaying text with inlines in it, I hoped that I could somehow use your HtmlRenderer ;).
/// <summary>
/// Handle when dependency property value changes to update the underline HtmlContainer with the new value.
/// </summary>
private static Action<IAvaloniaObject, AvaloniaPropertyChangedEventArgs> OnAvaloniaProperty_valueChanged = new Action<IAvaloniaObject, AvaloniaPropertyChangedEventArgs>((AvaloniaObject, e) =>
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> e)
{
var control = AvaloniaObject as HtmlLabel;
if (control != null)
base.OnPropertyChanged(e);
if (e.Property == AutoSizeProperty)
{
if (e.Property == AutoSizeProperty)
if (e.NewValue.GetValueOrDefault<bool>())
{
if ((bool)e.NewValue)
{
AvaloniaObject.SetValue(AutoSizeHeightOnlyProperty, false);
control.InvalidateMeasure();
control.InvalidateVisual();
}
SetValue(AutoSizeHeightOnlyProperty, false);
}
else if (e.Property == AutoSizeHeightOnlyProperty)
}
else if (e.Property == AutoSizeHeightOnlyProperty)
{
if (e.NewValue.GetValueOrDefault<bool>())
{
if ((bool)e.NewValue)
{
AvaloniaObject.SetValue(AutoSizeProperty, false);
control.InvalidateMeasure();
control.InvalidateVisual();
}
SetValue(AutoSizeProperty, false);
}
}
});
}
#endregion
}
When trying to use it on the nightly, I get the following error:
System.IO.FileNotFoundException: Could not load file or assembly 'Avalonia.Visuals, Version=0.10.0.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b'. The system cannot find the file specified.
I assume that is because of this change:
https://github.com/AvaloniaUI/Avalonia/wiki/Breaking-Changes
Avalonia.Animation, Avalonia.Input, Avalonia.Interactivity, Avalonia.Layout, Avalonia.Visuals and Avalonia.Styling assemblies were merged into a Avalonia.Base assembly. While API surface wasn't changed, it's still a binary breaking change, and third-party packages needs to be recompiled to work with a new version.
So this package needs to be recompiled to work with it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.