dotnet / dotnet/wpf

Set TextFormattingMode for GlyphRun

Open
#2,638 2 comments 2 reactions 0 assignees View on GitHub
Enhancement Requested
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

Is there any reason why `TextFormattingMode` is fixed to `Ideal` for `GlyphRun`s?

I need it to be `Display` and the only current way to do that is setting `_textFormattingMode` through reflection.

I suggest adding a public property that is settable only during initialization like all the others:

```C#
public TextFormattingMode TextFormattingMode
{
get
{
CheckInitialized();
return _textFormattingMode;
}
set
{
CheckInitializing(); // This can only be set during initialization.
_textFormattingMode = value;
}
}
```

Another option would be making `GlyphRun.TryCreate` method public.

https://github.com/dotnet/wpf/blob/master/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/GlyphRun.cs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.