2010-11-10 12 views

Respuesta

38

La fuente "predeterminada" es la fuente del sistema actual de su sistema operativo actual. Tahoma es la fuente de sistema predeterminada de Windows XP, en Vista, Windows 7 es la interfaz de usuario de Segoe.

+0

Pero al abrir MS Word la fuente por defecto es "Times New Roman" .. –

+9

Esa es la fuente predeterminada que * Tipo * pero no con la fuente de la interfaz de usuario (es decir, el fuente utilizada en los menús y botones de Word). – bitbonk

+0

¿Alguna idea para Windows 8? –

3

En Windows 8, parece que la fuente alternativa es la interfaz de usuario de Segoe con una línea de base 0.9 y un espaciado de línea de 1.2.

Simulating WPF default font

<Page 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:clr="clr-namespace:System;assembly=mscorlib"> 
    <Page.Resources> 
     <clr:String x:Key="someText">The quick brown fox, ABCD, 1234567890, /@#</clr:String> 
     <SolidColorBrush x:Key="lightColor">#bbbbbb</SolidColorBrush> 
     <SolidColorBrush x:Key="darkColor">#000000</SolidColorBrush> 
     <FontFamily x:Key="default">non existent font</FontFamily> 
     <FontFamily x:Key="segoe">Segoe UI</FontFamily> 
     <FontFamily x:Key="segoe_base" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/composite-font" 
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
       xmlns:s="clr-namespace:System;assembly=mscorlib" 
       Baseline="0.9" 
       LineSpacing="1.2"> 
     <FontFamily.FamilyNames> 
      <s:String x:Key="en-US" >Baseline Segoe UI</s:String> 
     </FontFamily.FamilyNames> 
     <FontFamily.FamilyMaps> 
      <FontFamilyMap Target="Segoe UI" /> 
     </FontFamily.FamilyMaps> 
     </FontFamily> 
    </Page.Resources> 

    <StackPanel Margin="10" Width="250"> 
     <TextBlock TextWrapping="Wrap">Segoe UI with a baseline of 0.9 and line spacing of 1.2 lines up with the default font</TextBlock> 
     <Grid Margin="5"> 
     <TextBlock Foreground="{StaticResource darkColor}" TextWrapping="Wrap" FontSize="20" FontFamily="{StaticResource default}" Text="{StaticResource someText}"/> 
     <TextBlock Foreground="{StaticResource lightColor}" TextWrapping="Wrap" FontSize="20" FontFamily="{StaticResource segoe_base}" Text="{StaticResource someText}"/> 
     </Grid> 
     <TextBlock Margin="0,10,0,0" TextWrapping="Wrap">Segoe UI with the default baseline and line spacing does not line up with the default font</TextBlock> 
     <Grid Margin="5"> 
     <TextBlock Foreground="{StaticResource darkColor}" TextWrapping="Wrap" FontSize="20" FontFamily="{StaticResource default}" Text="{StaticResource someText}"/> 
     <TextBlock Foreground="{StaticResource lightColor}" TextWrapping="Wrap" FontSize="20" FontFamily="{StaticResource segoe}" Text="{StaticResource someText}"/> 
     </Grid> 
    </StackPanel> 
    </Page> 
+1

Vale la pena mencionar que esta familia de fuentes proviene de la propiedad estática 'SystemFonts.MessageFontFamily'. Por lo tanto, si alguna vez necesita usarlo en algún lugar de su aplicación, debe leerlo desde allí en lugar de construir la nueva instancia de 'FontFamily' usted mismo. – torvin

Cuestiones relacionadas