aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graphics/direct2d/Font.h
blob: 0e7af622fd3faf25be0e697fef4f56f58b850532 (plain)
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
#pragma once
#include "Base.h"

#include <cru/platform/graphics/Font.h>

namespace cru::platform::graphics::direct2d {
class CRU_WIN_GRAPHICS_DIRECT_API DWriteFont
    : public DirectGraphicsResource,
      public virtual IFont,
      public virtual IComResource<IDWriteTextFormat> {
 public:
  DWriteFont(DirectGraphicsFactory* factory, std::string font_family,
             float font_size);

  IDWriteTextFormat* GetComInterface() const override {
    return text_format_.Get();
  }

  std::string GetFontName() override;
  float GetFontSize() override;

 private:
  std::string font_family_;
  Microsoft::WRL::ComPtr<IDWriteTextFormat> text_format_;
};
}  // namespace cru::platform::graphics::direct2d