chromium/third_party/harfbuzz-ng/src/src/hb-cff-interp-common.hh

/*
 * Copyright © 2018 Adobe Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Adobe Author(s): Michiharu Ariza
 */
#ifndef HB_CFF_INTERP_COMMON_HH
#define HB_CFF_INTERP_COMMON_HH

extern HB_INTERNAL const unsigned char *endchar_str;

namespace CFF {

usingnamespaceOT;

op_code_t;


/* === Dict operators === */

/* One byte operators (0-31) */
#define OpCode_version
#define OpCode_Notice
#define OpCode_FullName
#define OpCode_FamilyName
#define OpCode_Weight
#define OpCode_FontBBox
#define OpCode_BlueValues
#define OpCode_OtherBlues
#define OpCode_FamilyBlues
#define OpCode_FamilyOtherBlues
#define OpCode_StdHW
#define OpCode_StdVW
#define OpCode_escape
#define OpCode_UniqueID
#define OpCode_XUID
#define OpCode_charset
#define OpCode_Encoding
#define OpCode_CharStrings
#define OpCode_Private
#define OpCode_Subrs
#define OpCode_defaultWidthX
#define OpCode_nominalWidthX
#define OpCode_vsindexdict
#define OpCode_blenddict
#define OpCode_vstore
#define OpCode_reserved25
#define OpCode_reserved26
#define OpCode_reserved27

/* Numbers */
#define OpCode_shortint
#define OpCode_longintdict
#define OpCode_BCD
#define OpCode_reserved31

/* 1-byte integers */
#define OpCode_OneByteIntFirst
#define OpCode_OneByteIntLast

/* 2-byte integers */
#define OpCode_TwoBytePosInt0
#define OpCode_TwoBytePosInt1
#define OpCode_TwoBytePosInt2
#define OpCode_TwoBytePosInt3

#define OpCode_TwoByteNegInt0
#define OpCode_TwoByteNegInt1
#define OpCode_TwoByteNegInt2
#define OpCode_TwoByteNegInt3

/* Two byte escape operators 12, (0-41) */
#define OpCode_ESC_Base
#define Make_OpCode_ESC(byte2)

inline op_code_t Unmake_OpCode_ESC (op_code_t op)  {}
inline bool Is_OpCode_ESC (op_code_t op) {}
inline unsigned int OpCode_Size (op_code_t op) {}

#define OpCode_Copyright
#define OpCode_isFixedPitch
#define OpCode_ItalicAngle
#define OpCode_UnderlinePosition
#define OpCode_UnderlineThickness
#define OpCode_PaintType
#define OpCode_CharstringType
#define OpCode_FontMatrix
#define OpCode_StrokeWidth
#define OpCode_BlueScale
#define OpCode_BlueShift
#define OpCode_BlueFuzz
#define OpCode_StemSnapH
#define OpCode_StemSnapV
#define OpCode_ForceBold
#define OpCode_reservedESC15
#define OpCode_reservedESC16
#define OpCode_LanguageGroup
#define OpCode_ExpansionFactor
#define OpCode_initialRandomSeed
#define OpCode_SyntheticBase
#define OpCode_PostScript
#define OpCode_BaseFontName
#define OpCode_BaseFontBlend
#define OpCode_reservedESC24
#define OpCode_reservedESC25
#define OpCode_reservedESC26
#define OpCode_reservedESC27
#define OpCode_reservedESC28
#define OpCode_reservedESC29
#define OpCode_ROS
#define OpCode_CIDFontVersion
#define OpCode_CIDFontRevision
#define OpCode_CIDFontType
#define OpCode_CIDCount
#define OpCode_UIDBase
#define OpCode_FDArray
#define OpCode_FDSelect
#define OpCode_FontName


/* === CharString operators === */

#define OpCode_hstem
#define OpCode_Reserved2
#define OpCode_vstem
#define OpCode_vmoveto
#define OpCode_rlineto
#define OpCode_hlineto
#define OpCode_vlineto
#define OpCode_rrcurveto
#define OpCode_Reserved9
#define OpCode_callsubr
#define OpCode_return
//#define OpCode_escape		 12 /* CFF, CFF2 */
#define OpCode_Reserved13
#define OpCode_endchar
#define OpCode_vsindexcs
#define OpCode_blendcs
#define OpCode_Reserved17
#define OpCode_hstemhm
#define OpCode_hintmask
#define OpCode_cntrmask
#define OpCode_rmoveto
#define OpCode_hmoveto
#define OpCode_vstemhm
#define OpCode_rcurveline
#define OpCode_rlinecurve
#define OpCode_vvcurveto
#define OpCode_hhcurveto
//#define OpCode_shortint	 28 /* CFF, CFF2 */
#define OpCode_callgsubr
#define OpCode_vhcurveto
#define OpCode_hvcurveto

#define OpCode_fixedcs

/* Two byte escape operators 12, (0-41) */
#define OpCode_dotsection
#define OpCode_ReservedESC1
#define OpCode_ReservedESC2
#define OpCode_and
#define OpCode_or
#define OpCode_not
#define OpCode_ReservedESC6
#define OpCode_ReservedESC7
#define OpCode_ReservedESC8
#define OpCode_abs
#define OpCode_add
#define OpCode_sub
#define OpCode_div
#define OpCode_ReservedESC13
#define OpCode_neg
#define OpCode_eq
#define OpCode_ReservedESC16
#define OpCode_ReservedESC17
#define OpCode_drop
#define OpCode_ReservedESC19
#define OpCode_put
#define OpCode_get
#define OpCode_ifelse
#define OpCode_random
#define OpCode_mul
//#define OpCode_reservedESC25	Make_OpCode_ESC(25)
#define OpCode_sqrt
#define OpCode_dup
#define OpCode_exch
#define OpCode_index
#define OpCode_roll
#define OpCode_reservedESC31
#define OpCode_reservedESC32
#define OpCode_reservedESC33
#define OpCode_hflex
#define OpCode_flex
#define OpCode_hflex1
#define OpCode_flex1


#define OpCode_Invalid


struct number_t
{};

/* byte string */
struct UnsizedByteStr : UnsizedArrayOf <HBUINT8>
{};

/* A byte string associated with the current offset and an error condition */
struct byte_str_ref_t
{};

/* stack */
template <typename ELEM, int LIMIT>
struct cff_stack_t
{};

/* argument stack */
template <typename ARG=number_t>
struct arg_stack_t : cff_stack_t<ARG, 513>
{};

/* an operator prefixed by its operands in a byte string */
struct op_str_t
{};

/* base of OP_SERIALIZER */
struct op_serializer_t
{};

template <typename VAL>
struct parsed_values_t
{};

template <typename ARG=number_t>
struct interp_env_t
{};

num_interp_env_t;

template <typename ARG=number_t>
struct opset_t
{};

template <typename ENV>
struct interpreter_t
{};

} /* namespace CFF */

#endif /* HB_CFF_INTERP_COMMON_HH */