2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2013-12-02 20:49:27 +04:00
|
|
|
* 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-07-08 09:08:00 +03:00
|
|
|
#include "mozilla/UniquePtr.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:
|
2016-12-01 01:50:22 +03:00
|
|
|
MathMLTextRunFactory(mozilla::UniquePtr<nsTransformingTextRunFactory>
|
|
|
|
aInnerTransformingTextRunFactory,
|
2014-11-05 13:58:00 +03:00
|
|
|
uint32_t aFlags, uint8_t aSSTYScriptLevel,
|
|
|
|
float aFontInflation)
|
2018-05-30 22:15:35 +03:00
|
|
|
: mInnerTransformingTextRunFactory(
|
|
|
|
std::move(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:
|
2016-12-01 01:50:22 +03:00
|
|
|
mozilla::UniquePtr<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_*/
|