How to scale non-built-in/custom fonts in wpf C# -
i trying make program has kind of launch screen before kicking actual program itself. i've decided use wpf program, therefore, launch screen must written in xaml. kind of got knack of it, ran problem while trying scale font downloaded off internet. seems if scaling works built-in and/or system fonts. there way able scale anyways? every time try method of putting inside viewbox scales down. tried replacing text calibri see if fix it, , sure enough did. however, clear, not want use calibri or other built-in font, unless "clean". wondering, font called gidole. thanks. here xaml code:
<window x:name="startpage" x:class="modernboard.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:modernboard" mc:ignorable="d" title="modernboard welcome page" showintaskbar="false" resizemode="noresize" windowstartuplocation="centerscreen" background="#ff191919" foreground="#ffe6e6e6" horizontalalignment="center" verticalalignment="center" scrollviewer.verticalscrollbarvisibility="disabled" fontfamily="gidole" snapstodevicepixels="true" height="260.301" width="653.627" fontstretch="expanded"> <viewbox horizontalalignment="left" height="231" verticalalignment="top" width="648" stretch="none"> <grid> <label x:name="welcometo" content="welcome to" horizontalalignment="left" margin="38,27,0,0" verticalalignment="top" width="82" height="27" fontfamily="gidole" fontweight="bold" foreground="#ffe6e6e6"/> <label x:name="modern" content="modern" horizontalalignment="left" margin="37,36,0,0" verticalalignment="top" width="356" height="120" fontsize="90" foreground="#ffe6e6e6" fontfamily="gidole" fontweight="thin"/> <label x:name="board" content="board" horizontalalignment="left" margin="336,36,0,0" verticalalignment="top" width="265" height="120" fontsize="90" foreground="#ffe6e6e6" fontfamily="gidole" fontweight="bold"/> <button x:name="new" content="new board" horizontalalignment="left" margin="44,135,0,0" verticalalignment="top" width="272" fontweight="demibold" foreground="#ffe6e6e6" background="#2c406e" borderthickness="0" height="24"/> <button x:name="open" content="open board" horizontalalignment="left" margin="329,135,0,0" verticalalignment="top" width="272" fontweight="demibold" foreground="#ffe6e6e6" background="#2c406e" borderthickness="0" height="24"/> <button x:name="import" content="import file" horizontalalignment="left" margin="44,168,0,0" verticalalignment="top" width="557" fontweight="demibold" foreground="#ffe6e6e6" background="#2c406e" borderthickness="0" height="24"/> </grid> </viewbox> </window>
here screenshot of preview: preview
here program looks like, while running: running
thanks in advance,
alex fanat
you can 'scale' font specifying fontsize attribute on 'welcome to' label. may want consider removing width/height attributes otherwise you'll see label text cropped.
Comments
Post a Comment