Skip to content

Commit

Permalink
Small default font update
Browse files Browse the repository at this point in the history
  • Loading branch information
FremyCompany_cp authored and FremyCompany_cp committed Feb 16, 2011
1 parent a39d549 commit 0aa414e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion FC.MathEditor/WpfMathEditor/Classes/MathElement.Layout.vb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
Get
If _FontSize Is Nothing Then
If Parent Is Nothing Then
Return 14 + 2 / 3
Return 20
Else
_FontSize = Parent.FontSize
Return _FontSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@

Public Overrides Sub Draw(ByVal DG As System.Windows.Media.DrawingContext)
' IM is used to modify the drawing zone
DG.PushTransform(New TranslateTransform(IM.Left, IM.Top))
'Dim FT = New FormattedText(This.C.ToString(), Globalization.CultureInfo.CurrentCulture, FlowDirection.LeftToRight, This.Font, This.S, Brushes.Black)
'DG.PushTransform(New TranslateTransform(0, H - BH - FT.Baseline))
DG.PushTransform(New TranslateTransform(0 * IM.Left, IM.Top))

'DG.DrawText(FT, New Point(0, This.S * This.GlyphFont.Baseline - FT.Baseline))
' OLD CODE WHICH IS NOT WORKING PROPERLY BUT HAS MORE BEAUTIFUL OUTPUT
'Dim FT = New FormattedText(This.C.ToString(), Globalization.CultureInfo.CurrentCulture, FlowDirection.LeftToRight, This.Font, This.FontSize, Brushes.Black)
'DG.PushTransform(New TranslateTransform(0, H - BH - FT.Baseline))
'DG.DrawText(FT, New Point(0, This.FontSize * This.GlyphFont.Baseline - FT.Baseline))

DG.DrawGlyphRun(Brushes.Black, This.GlyphRun)
DG.Pop()
Expand Down
11 changes: 10 additions & 1 deletion FC.MathEditor/WpfMathEditor/Glyphs/UnicodeGlyph.vb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,23 @@

Public Sub New(ByVal C As Char, ByVal F As Typeface, ByVal S As Double?)
' Field initialization
Me.C = C : Me.Font = F : Me.FontSize = S
Me.C = C

' MathElement properties
Export = New UnicodeGlyphExportHelper(Me)
_Children = New GlyphChildrenHelper(Me)

' End init
If F IsNot Nothing Then
Me._Font = F : Me._IsFontDefined = True
End If

If S IsNot Nothing Then
Me._FontSize = S : Me._IsFontSizeDefined = True
End If

GenerateData()

End Sub

Private C As Char
Expand Down

0 comments on commit 0aa414e

Please sign in to comment.