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
0
votes
1 answer

How do I get height of DirectWrite layout?

I am aware that I can call IDWriteTextLayout::GetMetrics, but this gives me the boundaries of the text including space above and below the text for the ascender and descender, etc. However, what I'm looking for is the exact amount of space that the…
laptou
  • 6,389
  • 2
  • 28
  • 59
0
votes
1 answer

How can I create a DirectWrite font with a certain stretch, based on a LOGFONT structure?

I have a LOGFONT structure that I convert to an IDWriteFont using CreateFontFromLOGFONT(): IDWriteFont* dWriteFont = nullptr; if (FAILED(dWriteGdiInterop->CreateFontFromLOGFONT(&logFont, &dWriteFont))) return; If the LOGFONT describes a Tw Cen MT…
Jaap Scheper
  • 67
  • 11
0
votes
0 answers

Soft hyphens with DirectWrite API

In a sample application DWriteSimpleHelloWorld I render a text wszText_ = L"Hello World using Direct\u00ADWrite!"; to a DWrite HwndRenderTarget -- effectively, to a window of my application. I render text with a DrawText method of…
V.V.T
  • 231
  • 1
  • 7
0
votes
1 answer

When can an IDWriteFontFace have more than one file?

IDWriteFontFace.GetFiles() returns a collection of font files. This puzzles me because I don't know of any font format which can split a single font face across multiple files. (The reverse is not the case; a font collection file can hold multiple…
bright
  • 4,700
  • 1
  • 34
  • 59
0
votes
2 answers

I can't get this example from DirectWrite to run in V2015

I got the example below from this page in MS, but the code doesn't link due to this message: error LNK2019: unresolved external symbol __imp__DWriteCreateFactory@12 referenced in function _wmain I repeat the code below to facilitate its…
Mao
  • 1,065
  • 8
  • 12
0
votes
1 answer

Is there anyway I could set width and layout width to be the same in Directwrite TextLayout?

Whenever I render a text using text layout object, it's apparent that actual width of text is not same as the width of layout depending on enable option in text wrapping. I would like to know if there is anyway I could do to set width and layout…
Mazer
  • 11
  • 2
0
votes
3 answers

Reading font file content in winrt

How to read font file stream from WinRT platform? I need to get font file content from C# UWP. As far as you probably know there is no way to read files from Fonts folder directly. FilePicker is also not an option for me, since it's not a user…
Access Denied
  • 8,723
  • 4
  • 42
  • 72
0
votes
2 answers

How to make text scroll in an edit box?

I am making a custom edit box using direct 2D and direct write. The painting stuff (box) is done by direct 2D. I take input from WM_CHAR message and append it to a string. This string gets written in the box. Now the problem is that whenever the…
0
votes
1 answer

Direct2D/DirectDraw will only draw text with Arial font

I am using Direct2D for some graphics, I have gotten it to draw text with DirectDraw (using the DrawText function on the ID2D1RenderTarget) but for some reason it will not draw with the font I want. When I create a text format for the font I want I…
Captain Picard
  • 119
  • 4
  • 12
0
votes
1 answer

SharpDX DirectWrite rotate text

I wondered how to rotate a text rendered with Direct2D with SharpDX. Can not find any possiblity in RenderTarget2D.DrawText() or RenderTarget2D.DrawTextLayout()
zaimen
  • 157
  • 1
  • 12
0
votes
1 answer

IDWriteFactory::CreateTextFormat() failing

I'm facing a problem which I'm killing myself over. I have the following code: ComPtr factory; DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), factory.GetAddressOf(); ComPtr
user2578223
0
votes
1 answer

Realising scrolling text with DirectWrite

I have a string that stores all kind of logged data. This data should be accessible via a console. The console has of course only a limited height. Therefore, I do not need to render the entire text, but only, what is visible. For this I have a…
NOhs
  • 2,780
  • 3
  • 25
  • 59
0
votes
0 answers

Calculate the width of a unicode character

I am trying to calculate the width of the unicode character in directwrite without using GDI api's .My issue is some characters are full width and some are half width characters hence below formula doesn't work as leftside bearings and right side…
Girija Ram
  • 61
  • 8
0
votes
1 answer

Web vs Desktop for complex font rendering engine

THE PROBLEM I wish to develop a small desktop publishing application for the Urdu language. This is a right to left language but the typography can be very complex. At its simplist one can use a Unicode font and this is the approach used by the BBC…
Tyler Durden
  • 303
  • 5
  • 12
0
votes
1 answer

DirectWrite'ing glyphs such that the em square has a specific size

I'm working on an application that renders music notation. The musical symbol are specified in regular font files, which use the convention that the height of the em square corresponds to the height of a regular five-line staff of music. For…
Trillian
  • 6,207
  • 1
  • 26
  • 36
1 2 3
9
10