tor-browser

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

MathMLTextRunFactory.h (1731B)


      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 MATHMLTEXTRUNFACTORY_H_
      8 #define MATHMLTEXTRUNFACTORY_H_
      9 
     10 #include "mozilla/UniquePtr.h"
     11 #include "nsTextRunTransformations.h"
     12 
     13 /**
     14 * Builds textruns that render their text with MathML specific renderings.
     15 */
     16 class MathMLTextRunFactory : public nsTransformingTextRunFactory {
     17 public:
     18  MathMLTextRunFactory(mozilla::UniquePtr<nsTransformingTextRunFactory>
     19                           aInnerTransformingTextRunFactory,
     20                       uint32_t aFlags, uint8_t aSSTYScriptLevel,
     21                       float aFontInflation)
     22      : mInnerTransformingTextRunFactory(
     23            std::move(aInnerTransformingTextRunFactory)),
     24        mFlags(aFlags),
     25        mFontInflation(aFontInflation),
     26        mSSTYScriptLevel(aSSTYScriptLevel) {}
     27 
     28  static uint32_t MathVariant(uint32_t aCh, mozilla::StyleMathVariant aMathVar);
     29  virtual void RebuildTextRun(nsTransformedTextRun* aTextRun,
     30                              mozilla::gfx::DrawTarget* aRefDrawTarget,
     31                              gfxMissingFontRecorder* aMFR) override;
     32  enum {
     33    // Style effects which may override single character <mi> behaviour
     34    MATH_FONT_FEATURE_DTLS = 0x4,  // font feature dtls should be set
     35  };
     36 
     37 protected:
     38  mozilla::UniquePtr<nsTransformingTextRunFactory>
     39      mInnerTransformingTextRunFactory;
     40  uint32_t mFlags;
     41  float mFontInflation;
     42  uint8_t mSSTYScriptLevel;
     43 };
     44 
     45 #endif /*MATHMLTEXTRUNFACTORY_H_*/