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
16
votes
3 answers

Disable Cleartype (text anti-aliasing) in IE9

It's well documented (e.g. here) that IE9 ignores the OS-wide settings for font smoothing (aka anti-aliasing). Even if font-smoothing and ClearType are disabled in Windows, IE still shows anti-aliased fonts, which some users struggle to read,…
Justin Grant
  • 44,807
  • 15
  • 124
  • 208
11
votes
2 answers

Directwrite: Getting a font's height

My objective: I want to get the height of an IDWriteTextFormat's font so I can calculate how many lines of text can fit in an IDWriteTextLayout of a certain height. My problem: Right now I'm using this code to calculate the visible number of…
kittykitty
  • 221
  • 2
  • 7
10
votes
2 answers

How do I balance script-oriented OpenType features with other OpenType features using DirectWrite?

Full disclosure: I'm working on my libui GUI framework's text API. This wraps DirectWrite on Windows, Core Text on OS X, and Pango (which uses HarfBuzz for OpenType shaping) on other Unixes. One of the text formatting attributes I want to specify is…
andlabs
  • 11,290
  • 1
  • 31
  • 52
7
votes
2 answers

Partial ligature selection with DirectWrite

Using HitTestTextPosition style API from IDWriteTextLayout I did not managed to handle properly text positions inside "ti", "ffi" or other ligatures with fonts like Calibri. It always returns position after or before ligature not inside like t|i or…
Filip Kunc
  • 631
  • 1
  • 8
  • 19
7
votes
1 answer

How can I render mixed-colour text in DirectWrite?

I want to use DirectWrite for mixed-colour text formatting (syntax highlighting, to be precise), but can't seem to find a way to do it, either in the Layout or Typography options. The only option is passing a Brush when rendering the text, which…
Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166
6
votes
3 answers

Unresolved external symbol

Main article there is a header file and a source file. After copying those two files and adding few headers: #include #include #pragma comment(lib, "d2d1") #include #include #include…
There is nothing we can do
  • 23,727
  • 30
  • 106
  • 194
6
votes
5 answers

Is it possible to enable directwrite in chrome?

I prefer google chrome in almost every way above IE10, but one thing I hate is that fonts just look much better in IE10. This especially visible with small math fonts. They look like pdf quality in IE10. After searching a little bit, I found out…
90intuition
  • 966
  • 3
  • 12
  • 25
5
votes
1 answer

Direct2D - How to draw a text as close as possible to GDI rendering

I'm working with Embarcadero RAD Studio XE7 compiler (C++ Builder), in which I'm trying the provided Direct2D API. My purpose is to create applications which provide the exact same rendering as the GDI did, but which also may benefit the new…
Jean-Milost Reymond
  • 1,833
  • 1
  • 15
  • 36
5
votes
1 answer

What is the correct, modern way to handle arbitrary text input in a custom control on Windows? WM_CHAR? IMM? TSF?

I want to be able to support text input in a custom Windows control, just like the EDIT and rich edit controls already do, but not subclassing either of those. The control currently uses Direct2D and DirectWrite to draw text, and runs on Windows…
andlabs
  • 11,290
  • 1
  • 31
  • 52
5
votes
3 answers

Why don't Direct2D and DirectWrite use traditional COM objects?

I'm toying with a little 2D game engine in C# and decided to use Direct2D and DirectWrite for rendering. I know there's the Windows API Code Pack and SlimDX, but I'd really like to dig in and write an interface from scratch. I'm trying to do it…
David Brown
  • 35,411
  • 11
  • 83
  • 132
5
votes
1 answer

How does DirectWrite (CreateTextFormat) pick the fallback font(s)?

The documentation for CreateTextFormat says nothing about font fallback selection, but if the default (NULL = system) collection is chosen, then DirectWrite clearly implements font fallback. For example, if I add two glyphs not found in the Gabriola…
Fizz
  • 4,782
  • 1
  • 24
  • 51
4
votes
1 answer

Shortest path to render from DirectWrite to Direct3D11?

Man so much has changed since I learned DirectX 7. Everywhere I look (except Wikipedia), it says I have to render from DWrite to D2D or GDI before I can do anything. Is that Wikipedia article wrong? Can I not render to Direct3D? I'd like to avoid…
Rei Miyasaka
  • 7,007
  • 6
  • 42
  • 69
4
votes
2 answers

Closest cross-platform alternative to Direct2D/DirectWrite?

What are some good cross-platform alternatives to Windows-specific 2D APIs? I'm looking for an API for rendering simple geometric objects as well as an API for rendering text with subpixel antialiasing (ClearType) and OpenType support, specifically…
Dmitri Nesteruk
  • 23,067
  • 22
  • 97
  • 166
4
votes
0 answers

How to set font weight when using system.drawing / directWrite.

TLDNR: It is 2017. How can I set font weight when using System.Drawing.createfont Longer version: Under GDI32 I would create a device context, fill in a LOGFONT structure including a weight value like 400,500,600 etc, and have the font created. The…
Vanquished Wombat
  • 9,075
  • 5
  • 28
  • 67
4
votes
1 answer

DirectWrite: Character Spacing on Windows 7

I need to convert some text-to-bitmap rendering routines in existing C++ code that is using GDI and GDI+ to use DirectWrite (CFF support and OTF-feature support required). I'm new to DirectWrite. Spending some time on research on what's required for…
1
2 3
9 10