-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTextHelpers.h
45 lines (41 loc) · 1.28 KB
/
TextHelpers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved
//
//----------------------------------------------------------------------------
#pragma once
//
// CreateTextFormatFromLOGFONT
//
// Helper function that creates a DWrite text format object from
// the specified LOGFONT.
//
HRESULT CreateTextFormatFromLOGFONT(
LOGFONT const& logFont,
float fontSize,
OUT IDWriteTextFormat** textFormat
);
//
// MakeRotateTransform
//
// Given an angle and the center of rotatation, returns a matrix
// to be used as a world transform.
//
DWRITE_MATRIX MakeRotateTransform(
float angle, // angle in degrees
float x, // x coordinate of the center of rotation
float y // y coordinate of the center of rotation
);
//
// Conversions between pixels and DIPs.
//
// Note: In this sample program, floating point coordinates are
// always in DIPs and integer coordinates are always in pixels.
//
float PixelsToDipsX(int x);
float PixelsToDipsY(int y);
int DipsToPixelsX(float x);
int DipsToPixelsY(float y);