2013-12-02 08:49:27 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2014-01-15 06:49:20 -08:00
|
|
|
#ifndef MATHMLTEXTRUNFACTORY_H_
|
|
|
|
#define MATHMLTEXTRUNFACTORY_H_
|
2013-12-02 08:49:27 -08:00
|
|
|
|
|
|
|
#include "nsTextRunTransformations.h"
|
|
|
|
|
|
|
|
/**
|
2014-01-15 06:49:20 -08:00
|
|
|
* Builds textruns that render their text with MathML specific renderings.
|
2013-12-02 08:49:27 -08:00
|
|
|
*/
|
2014-01-15 06:49:20 -08:00
|
|
|
class MathMLTextRunFactory : public nsTransformingTextRunFactory {
|
2013-12-02 08:49:27 -08:00
|
|
|
public:
|
2014-01-15 06:49:20 -08:00
|
|
|
MathMLTextRunFactory(nsTransformingTextRunFactory* aInnerTransformingTextRunFactory,
|
2014-11-05 02:58:00 -08:00
|
|
|
uint32_t aFlags, uint8_t aSSTYScriptLevel,
|
|
|
|
float aFontInflation)
|
2014-01-15 06:49:20 -08:00
|
|
|
: mInnerTransformingTextRunFactory(aInnerTransformingTextRunFactory),
|
2014-06-25 02:20:00 -07:00
|
|
|
mFlags(aFlags),
|
2014-11-05 02:58:00 -08:00
|
|
|
mFontInflation(aFontInflation),
|
2014-01-15 06:49:20 -08:00
|
|
|
mSSTYScriptLevel(aSSTYScriptLevel) {}
|
2013-12-02 08:49:27 -08:00
|
|
|
|
|
|
|
virtual void RebuildTextRun(nsTransformedTextRun* aTextRun,
|
2014-12-22 08:35:54 -08:00
|
|
|
gfxContext* aRefContext,
|
2015-03-21 09:28:04 -07:00
|
|
|
gfxMissingFontRecorder* aMFR) override;
|
2014-06-25 02:20:00 -07:00
|
|
|
enum {
|
|
|
|
// Style effects which may override single character <mi> behaviour
|
|
|
|
MATH_FONT_STYLING_NORMAL = 0x1, // fontstyle="normal" has been set.
|
|
|
|
MATH_FONT_WEIGHT_BOLD = 0x2, // fontweight="bold" has been set.
|
2014-09-24 01:38:00 -07:00
|
|
|
MATH_FONT_FEATURE_DTLS = 0x4, // font feature dtls should be set
|
2014-06-25 02:20:00 -07:00
|
|
|
};
|
|
|
|
|
2013-12-02 08:49:27 -08:00
|
|
|
protected:
|
|
|
|
nsAutoPtr<nsTransformingTextRunFactory> mInnerTransformingTextRunFactory;
|
2014-06-25 02:20:00 -07:00
|
|
|
uint32_t mFlags;
|
2014-11-05 02:58:00 -08:00
|
|
|
float mFontInflation;
|
2014-01-15 06:49:20 -08:00
|
|
|
uint8_t mSSTYScriptLevel;
|
2013-12-02 08:49:27 -08:00
|
|
|
};
|
|
|
|
|
2014-01-15 06:49:20 -08:00
|
|
|
#endif /*MATHMLTEXTRUNFACTORY_H_*/
|