Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/layout/generic/MathMLTextRunFactory.h
Line
Count
Source (jump to first uncovered line)
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/. */
6
7
#ifndef MATHMLTEXTRUNFACTORY_H_
8
#define MATHMLTEXTRUNFACTORY_H_
9
10
#include "mozilla/UniquePtr.h"
11
#include "nsTextRunTransformations.h"
12
13
/**
14
 * Builds textruns that render their text with MathML specific renderings.
15
 */
16
class MathMLTextRunFactory : public nsTransformingTextRunFactory {
17
public:
18
  MathMLTextRunFactory(mozilla::UniquePtr<nsTransformingTextRunFactory> aInnerTransformingTextRunFactory,
19
                       uint32_t aFlags, uint8_t aSSTYScriptLevel,
20
                       float aFontInflation)
21
    : mInnerTransformingTextRunFactory(std::move(aInnerTransformingTextRunFactory)),
22
      mFlags(aFlags),
23
      mFontInflation(aFontInflation),
24
0
      mSSTYScriptLevel(aSSTYScriptLevel) {}
25
26
  virtual void RebuildTextRun(nsTransformedTextRun* aTextRun,
27
                              mozilla::gfx::DrawTarget* aRefDrawTarget,
28
                              gfxMissingFontRecorder* aMFR) override;
29
  enum {
30
    // Style effects which may override single character <mi> behaviour
31
    MATH_FONT_STYLING_NORMAL   = 0x1, // fontstyle="normal" has been set.
32
    MATH_FONT_WEIGHT_BOLD      = 0x2, // fontweight="bold" has been set.
33
    MATH_FONT_FEATURE_DTLS     = 0x4, // font feature dtls should be set
34
  };
35
36
protected:
37
  mozilla::UniquePtr<nsTransformingTextRunFactory> mInnerTransformingTextRunFactory;
38
  uint32_t mFlags;
39
  float mFontInflation;
40
  uint8_t mSSTYScriptLevel;
41
};
42
43
#endif /*MATHMLTEXTRUNFACTORY_H_*/