OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ |
| 6 #define CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ |
| 7 |
| 8 #include <dwrite.h> |
| 9 #include <dwrite_2.h> |
| 10 #include <wrl.h> |
| 11 |
| 12 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_win.h" |
| 13 #include "content/common/content_export.h" |
| 14 #include "ipc/ipc_sender.h" |
| 15 |
| 16 namespace content { |
| 17 |
| 18 // Implements an IDWriteFontFallback that uses IPC to proxy the fallback calls |
| 19 // to the system fallback in the browser process. |
| 20 class CONTENT_EXPORT FontFallback |
| 21 : public Microsoft::WRL::RuntimeClass< |
| 22 Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>, |
| 23 IDWriteFontFallback> { |
| 24 public: |
| 25 FontFallback(); |
| 26 |
| 27 HRESULT STDMETHODCALLTYPE |
| 28 MapCharacters(IDWriteTextAnalysisSource* source, |
| 29 UINT32 text_position, |
| 30 UINT32 text_length, |
| 31 IDWriteFontCollection* base_font_collection, |
| 32 const wchar_t* base_family_name, |
| 33 DWRITE_FONT_WEIGHT base_weight, |
| 34 DWRITE_FONT_STYLE base_style, |
| 35 DWRITE_FONT_STRETCH base_stretch, |
| 36 UINT32* mapped_length, |
| 37 IDWriteFont** mapped_font, |
| 38 FLOAT* scale) override; |
| 39 |
| 40 HRESULT STDMETHODCALLTYPE |
| 41 RuntimeClassInitialize(DWriteFontCollectionProxy* collection, |
| 42 IPC::Sender* sender_override); |
| 43 |
| 44 protected: |
| 45 ~FontFallback() override; |
| 46 |
| 47 private: |
| 48 IPC::Sender* sender_override_; |
| 49 Microsoft::WRL::ComPtr<DWriteFontCollectionProxy> collection_; |
| 50 |
| 51 DISALLOW_ASSIGN(FontFallback); |
| 52 }; |
| 53 |
| 54 } // namespace content |
| 55 |
| 56 #endif // CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ |
OLD | NEW |