2013-12-02 16:49:27 +00: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 14:49:20 +00:00
|
|
|
#ifndef MATHMLTEXTRUNFACTORY_H_
|
|
|
|
#define MATHMLTEXTRUNFACTORY_H_
|
2013-12-02 16:49:27 +00:00
|
|
|
|
|
|
|
#include "nsTextRunTransformations.h"
|
|
|
|
|
|
|
|
/**
|
2014-01-15 14:49:20 +00:00
|
|
|
* Builds textruns that render their text with MathML specific renderings.
|
2013-12-02 16:49:27 +00:00
|
|
|
*/
|
2014-01-15 14:49:20 +00:00
|
|
|
class MathMLTextRunFactory : public nsTransformingTextRunFactory {
|
2013-12-02 16:49:27 +00:00
|
|
|
public:
|
2014-01-15 14:49:20 +00:00
|
|
|
MathMLTextRunFactory(nsTransformingTextRunFactory* aInnerTransformingTextRunFactory,
|
2014-11-05 10:58:00 +00:00
|
|
|
uint32_t aFlags, uint8_t aSSTYScriptLevel,
|
|
|
|
float aFontInflation)
|
2014-01-15 14:49:20 +00:00
|
|
|
: mInnerTransformingTextRunFactory(aInnerTransformingTextRunFactory),
|
2014-06-25 09:20:00 +00:00
|
|
|
mFlags(aFlags),
|
2014-11-05 10:58:00 +00:00
|
|
|
mFontInflation(aFontInflation),
|
2014-01-15 14:49:20 +00:00
|
|
|
mSSTYScriptLevel(aSSTYScriptLevel) {}
|
2013-12-02 16:49:27 +00:00
|
|
|
|
|
|
|
virtual void RebuildTextRun(nsTransformedTextRun* aTextRun,
|
2014-12-22 16:35:54 +00:00
|
|
|
gfxContext* aRefContext,
|
2015-03-21 16:28:04 +00:00
|
|
|
gfxMissingFontRecorder* aMFR) override;
|
2014-06-25 09:20:00 +00: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 08:38:00 +00:00
|
|
|
MATH_FONT_FEATURE_DTLS = 0x4, // font feature dtls should be set
|
2014-06-25 09:20:00 +00:00
|
|
|
};
|
|
|
|
|
2013-12-02 16:49:27 +00:00
|
|
|
protected:
|
|
|
|
nsAutoPtr<nsTransformingTextRunFactory> mInnerTransformingTextRunFactory;
|
2014-06-25 09:20:00 +00:00
|
|
|
uint32_t mFlags;
|
2014-11-05 10:58:00 +00:00
|
|
|
float mFontInflation;
|
2014-01-15 14:49:20 +00:00
|
|
|
uint8_t mSSTYScriptLevel;
|
2013-12-02 16:49:27 +00:00
|
|
|
};
|
|
|
|
|
2014-01-15 14:49:20 +00:00
|
|
|
#endif /*MATHMLTEXTRUNFACTORY_H_*/
|