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