-
-
Notifications
You must be signed in to change notification settings - Fork 492
/
Copy pathTextFormat.h
41 lines (32 loc) · 1.01 KB
/
TextFormat.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
#pragma once
#include "TextFormat.g.h"
#include <ppl.h>
#include <wincodec.h>
#include <Dwrite_1.h>
#include <D2d1_3.h>
#include <map>
#include <winrt/Windows.Foundation.h>
using namespace concurrency;
using namespace winrt::Windows::Foundation::Collections;
using namespace winrt::Windows::Foundation::Numerics;
namespace winrt::Telegram::Native::implementation
{
struct TextFormat : TextFormatT<TextFormat>
{
TextFormat() = default;
TextFormat(winrt::com_ptr<IDWriteTextLayout> textLayout, uint32_t textLength, double fontSize, double maxWidth);
float2 ContentEnd(double fontSize, double width);
private:
winrt::com_ptr<IDWriteTextLayout> m_textLayout;
uint32_t m_textLength;
double m_fontSize;
double m_maxWidth;
HRESULT ContentEndImpl(double fontSize, double width, float2& offset);
};
}
namespace winrt::Telegram::Native::factory_implementation
{
struct TextFormat : TextFormatT<TextFormat, implementation::TextFormat>
{
};
}