Questions tagged [directwrite]

DirectWrite is a text layout and glyph rendering API by Microsoft. It was designed to replace GDI/GDI+ and Uniscribe for screen-oriented rendering and was shipped with Windows 7 and Windows Server 2008 R2, as well as Windows Vista and Windows Server 2008 (with Platform Update installed). DirectWrite provides these features

DirectWrite is a text layout and glyph rendering API by Microsoft. It was designed to replace GDI/GDI+ and Uniscribe for screen-oriented rendering and was shipped with Windows 7 and Windows Server 2008 R2, as well as Windows Vista and Windows Server 2008 (with Platform Update installed). DirectWrite provides these features

  • A device-independent text layout system that improves text readability in documents and in UI.
  • High-quality, sub-pixel, ClearType text rendering that can use GDI, Direct2D, or application-specific rendering technology.
  • Hardware-accelerated text, when used with Direct2D.
  • Support for multi-format text.
  • Support for the advanced typography features of OpenType fonts.
  • Support for the layout and rendering of text in all supported languages.
  • GDI-compatible layout and rendering.
149 questions
1
vote
1 answer

How get available OpenType features for given font in Directwrite?

I build a text editor and I use DirectWrite, I want to give the user the option to enable OpenType features on selected text, but not every font has all the features and many fonts do not at all. My question is how do I know which OpenType features…
codeDom
  • 1,623
  • 18
  • 54
1
vote
2 answers

DirectWrite ScriptAnalysis get script name from index

DirectWrite ScriptAnalysis Contains a UINT16 number that is zero-based index representation of writing system script. How can I know the name of the script? For example in English the number is equal to 49, and in Russian the number is equal to…
codeDom
  • 1,623
  • 18
  • 54
1
vote
1 answer

How to force enable Y-Axis Antialiasing for all font size on DirectWrite

I'm rendering text using DirectWrite. DirectWrite only enable y-axis antialiasing when font size is large, which makes CJK fonts looks bad. How to force enable Y-Axis Antialiasing for all font size?
Zz Tux
  • 600
  • 1
  • 5
  • 18
1
vote
2 answers

SharpDx: Setting character width

I am writing a C# Direct2D application using SharpDX, however I can understand answers/examples that are provided in C++. I want to render text and change the width of certain characters to look like the picture: The letter B expanded to 200% and…
codeDom
  • 1,623
  • 18
  • 54
1
vote
1 answer

Win32/Direct2D - how to render infinite scrolling listbox

I'm building a Win32 application with C++ which needs to display a list of relatively simple items from Twitter. Each item in the list would include the author and the tweet text along some icons. It would be nice to have smooth scrolling and…
Brian Lyttle
  • 14,558
  • 15
  • 68
  • 104
1
vote
1 answer

Get ABC character widths in SharpDX / DirectWrite

In GDI to get the ABC widths (left bearing, right bearing etc) for a character I would call GetCharABCWidths. How do I achieve the same measurements using SharpDX or DirectWrite, and should I expect the values to match between this and GDI for the…
Vanquished Wombat
  • 9,075
  • 5
  • 28
  • 67
1
vote
1 answer

Is there a port of SWT 3.6 to WPF?

recently i've been looking for a version of SWT that uses WPF (or DirectWrite) as its renderer. The last version of SWT ported to WPF that I've found was 3.3. Anyway, is there any port of SWT 3.6 to WPF? Thanks
Carlos Melo
  • 3,052
  • 3
  • 37
  • 45
1
vote
0 answers

Why Do Some Font's Letter Spacing Vary Between Font Renders But Not Others?

Why is there so much variation between how font renderers treat fonts? Specifically, why is letter spacing vary with some fonts & not with others? For example, why does "Open Sans" have near-identical letter spacing between all environments? But…
Markus
  • 518
  • 6
  • 18
1
vote
1 answer

How to get correct text width for oblique font in DirectWrite?

I create a IDWriteTextLayout object by the following code, hr = g_pDWriteFactory->CreateTextLayout(text, textLength, *g_pTextFormat, 200000000, 200000000, g_pTextLayout); then get the text width by text metric, DWRITE_TEXT_METRICS dtm; …
1
vote
1 answer

When I use DirectWrite to draw text on a GDI hdc, how to set a transparent back ground?

Now I am working on a legacy product which use GDI to draw text in screen. Now I try to use DirectWrite to draw text for better appearance and accurancy of font. I am very curious that has anyone done this before? I meet a problem that when I use…
1
vote
0 answers

How to fix random trimming of text in DirectWrite?

I'm displaying the fps of my application. When I change the size or position of the text, it sometimes isn't rendered properly and the layout rect is big enough. Anyone know how to fix this? Example code, only…
Cu29p
  • 51
  • 1
  • 4
1
vote
1 answer

Calls To ID2D1RenderTarget::DrawTextLayout() Not Working

Basically, given the following test code: CComPtr layout; wstring text2 = L"Here is some text."; this->currentLevelText->Formatting->TextFactory->CreateTextLayout(text2.c_str(), text2.length(),…
Nkosi Dean
  • 227
  • 8
  • 18
1
vote
1 answer

How do I specify directionality of ambiguous characters to IDWriteTextLayout?

Some characters have ambiguous directionality, like whitespace and punctuation marks. This can lead to text layout situations where there doesn't appear to be single correct layout without access to additional data to resolve the ambiguity. …
Jayonas
  • 401
  • 2
  • 12
1
vote
1 answer

How to use draw text on the canvas of listbox using DirectWrite in Delphi?

I am looking for a simple example to use TDirect2DCanvas for owner drawing each item of a listbox. Googling for DirectWrite gives the result to sample example to render text on the form. Being a student, my Delphi skill could not catch the tutorial…
Rabi Jayasawal
  • 441
  • 1
  • 9
  • 18
1
vote
2 answers

IDWriteInlineObject::GetOverhangMetrics method is never called

I have implemented IDWriteInlineObject interface to draw ID2D1Bitmap as inline object inside a text. Everything works fine except one: my implementation's GetOverhangMetrics method never get called. I've also tried a sample from DirectWrite SDK…
Ruslan Garipov
  • 530
  • 4
  • 13