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/. */
7 #ifndef MATHMLTEXTRUNFACTORY_H_
8 #define MATHMLTEXTRUNFACTORY_H_
10 #include "mozilla/UniquePtr.h"
11 #include "nsTextRunTransformations.h"
14 * Builds textruns that render their text with MathML specific renderings.
16 class MathMLTextRunFactory
: public nsTransformingTextRunFactory
{
18 MathMLTextRunFactory(mozilla::UniquePtr
<nsTransformingTextRunFactory
>
19 aInnerTransformingTextRunFactory
,
20 uint32_t aFlags
, uint8_t aSSTYScriptLevel
,
22 : mInnerTransformingTextRunFactory(
23 std::move(aInnerTransformingTextRunFactory
)),
25 mFontInflation(aFontInflation
),
26 mSSTYScriptLevel(aSSTYScriptLevel
) {}
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
;
33 // Style effects which may override single character <mi> behaviour
34 MATH_FONT_FEATURE_DTLS
= 0x4, // font feature dtls should be set
38 mozilla::UniquePtr
<nsTransformingTextRunFactory
>
39 mInnerTransformingTextRunFactory
;
42 uint8_t mSSTYScriptLevel
;
45 #endif /*MATHMLTEXTRUNFACTORY_H_*/