tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ScaledFontWin.h (1328B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef MOZILLA_GFX_SCALEDFONTWIN_H_
      8 #define MOZILLA_GFX_SCALEDFONTWIN_H_
      9 
     10 #include "ScaledFontBase.h"
     11 #include <windows.h>
     12 
     13 namespace mozilla {
     14 namespace gfx {
     15 
     16 class ScaledFontWin : public ScaledFontBase {
     17 public:
     18  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontWin, override)
     19  ScaledFontWin(const LOGFONT* aFont, const RefPtr<UnscaledFont>& aUnscaledFont,
     20                Float aSize);
     21 
     22  FontType GetType() const override { return FontType::GDI; }
     23 
     24  bool GetFontInstanceData(FontInstanceDataOutput aCb, void* aBaton) override;
     25 
     26  AntialiasMode GetDefaultAAMode() override;
     27 
     28  SkTypeface* CreateSkTypeface() override;
     29 
     30  bool MayUseBitmaps() override { return true; }
     31 
     32  bool UseSubpixelPosition() const override { return false; }
     33 
     34 protected:
     35  cairo_font_face_t* CreateCairoFontFace(
     36      cairo_font_options_t* aFontOptions) override;
     37 
     38 private:
     39  friend class DrawTargetSkia;
     40  LOGFONT mLogFont;
     41 };
     42 
     43 }  // namespace gfx
     44 }  // namespace mozilla
     45 
     46 #endif /* MOZILLA_GFX_SCALEDFONTWIN_H_ */