onizet / html2openxml

Html2OpenXml is a small .Net library that convert simple or advanced HTML to plain OpenXml components. This program has started in 2009, initially to convert user's comments from SharePoint to Word.
MIT License
297 stars 106 forks source link

Non integer font sizes specified with <FONT size= #129

Closed berthendrickx closed 6 months ago

berthendrickx commented 1 year ago

I noticed that if you specify FONT size="9.5pt" this is converted to a font size of 9 in Word, instead of 9,5

I suggest a small change to correct for this in Unit.cs:

public double ValueInPoint
{
    get { return (double) (type == UnitMetric.Point ? Math.Round(this.value * 2) / 2 : (float) valueInEmus / 12700L); }
}
onizet commented 6 months ago

I have committed this code. Thanks for reporting