microsoft / microsoft/WPF-Samples
HtmlFromXamlConverter.cs doesn't set units on CSS font-size attribute
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.7k
- Forks
- 3.3k
- Avg merge
- 12d 8h
- Merged PRs (30d)
- 2
Description
For all I know setting the units on a CSS font-size attribute is mandatory. I updated line 162 to the following in order to make it specify the font-size in points:
css = "font-size:"
+ Math.Round(double.Parse(xamlReader.Value, CultureInfo.InvariantCulture) / (96.0 / 72.0), 2)
.ToString("0.##", CultureInfo.InvariantCulture) + "pt;";
This only works for when the FontSize in the XAML is specified in points and without units (as it's generated by XamlWriter.Save).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading HtmlFromXamlConverter.cs around line 162 and compare the XAML font-size value produced by XamlWriter.Save with the CSS output. Done means generated CSS font-size values include appropriate units, including the point-based values described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100