Share via


GlyphRunDrawing.GlyphRun Propriété

Définition

Obtient ou définit le GlyphRun qui décrit le texte à dessiner.

public:
 property System::Windows::Media::GlyphRun ^ GlyphRun { System::Windows::Media::GlyphRun ^ get(); void set(System::Windows::Media::GlyphRun ^ value); };
public System.Windows.Media.GlyphRun GlyphRun { get; set; }
member this.GlyphRun : System.Windows.Media.GlyphRun with get, set
Public Property GlyphRun As GlyphRun

Valeur de propriété

GlyphRun

GlyphRun qui décrit le texte à dessiner. La valeur par défaut est null.

Exemples

L’exemple suivant utilise un GlyphRunDrawing pour dessiner le texte « Hello World ».

GlyphRun theGlyphRun = new GlyphRun(
    new GlyphTypeface(new Uri(@"C:\WINDOWS\Fonts\TIMES.TTF")),
    0,
    false,
    13.333333333333334,
    new ushort[]{43, 72, 79, 79, 82, 3, 58, 82, 85, 79, 71},
    new Point(0, 12.29),
    new double[]{
        9.62666666666667, 7.41333333333333, 2.96, 
        2.96, 7.41333333333333, 3.70666666666667, 
        12.5866666666667, 7.41333333333333, 
        4.44, 2.96, 7.41333333333333},
    null,
    null,
    null,
    null,
    null,
    null

    );

GlyphRunDrawing gDrawing = new GlyphRunDrawing(Brushes.Black, theGlyphRun);
<GlyphRunDrawing ForegroundBrush="Black">
  <GlyphRunDrawing.GlyphRun>
    <GlyphRun 
      CaretStops="{x:Null}" 
      ClusterMap="{x:Null}" 
      IsSideways="False" 
      GlyphOffsets="{x:Null}" 
      GlyphIndices="43 72 79 79 82 3 58 82 85 79 71" 
      BaselineOrigin="0,12.29"  
      FontRenderingEmSize="13.333333333333334" 
      DeviceFontName="{x:Null}" 
      AdvanceWidths="9.62666666666667 7.41333333333333 2.96 2.96 7.41333333333333 3.70666666666667 12.5866666666667 7.41333333333333 4.44 2.96 7.41333333333333" 
      BidiLevel="0">
      <GlyphRun.GlyphTypeface>
        <GlyphTypeface FontUri="C:\WINDOWS\Fonts\TIMES.TTF" />
      </GlyphRun.GlyphTypeface>
    </GlyphRun>
  </GlyphRunDrawing.GlyphRun>
</GlyphRunDrawing>

A GlyphRun est un objet de bas niveau destiné à être utilisé avec des scénarios de présentation de documents de format fixe et d’impression. Un moyen plus simple de dessiner du texte à l’écran consiste à utiliser un Label ou un TextBlock. Pour plus d’informations sur GlyphRun, consultez la présentation de l’objet GlyphRun et de l’élément Glyphs .

Remarques

Informations sur les propriétés de dépendance

Champ d’identificateur GlyphRunProperty
Propriétés de métadonnées définies sur true Aucun

S’applique à