jdk/src/share/native/sun/font/layout/GlyphPositionAdjustments.h
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 3935 afcdb712a9c5
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#ifndef __GLYPHPOSITIONADJUSTMENTS_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#define __GLYPHPOSITIONADJUSTMENTS_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#include "LETypes.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#include "OpenTypeTables.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
class LEGlyphStorage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
class LEFontInstance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
class GlyphPositionAdjustments
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
private:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    class Adjustment {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    public:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
        inline Adjustment();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        inline Adjustment(float xPlace, float yPlace, float xAdv, float yAdv, le_int32 baseOff = -1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        inline ~Adjustment();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        inline float    getXPlacement() const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        inline float    getYPlacement() const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        inline float    getXAdvance() const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        inline float    getYAdvance() const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        inline le_int32 getBaseOffset() const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        inline void     setXPlacement(float newXPlacement);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
        inline void     setYPlacement(float newYPlacement);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        inline void     setXAdvance(float newXAdvance);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        inline void     setYAdvance(float newYAdvance);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        inline void     setBaseOffset(le_int32 newBaseOffset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        inline void    adjustXPlacement(float xAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        inline void    adjustYPlacement(float yAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        inline void    adjustXAdvance(float xAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        inline void    adjustYAdvance(float yAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    private:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        float xPlacement;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        float yPlacement;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
        float xAdvance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        float yAdvance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        le_int32 baseOffset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        // allow copying of this class because all of its fields are simple types
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    class EntryExitPoint
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    public:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        inline EntryExitPoint();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        inline ~EntryExitPoint();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        inline le_bool isCursiveGlyph() const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        inline le_bool baselineIsLogicalEnd() const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        LEPoint *getEntryPoint(LEPoint &entryPoint) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        LEPoint *getExitPoint(LEPoint &exitPoint) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        inline void setEntryPoint(LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        inline void setExitPoint(LEPoint &newExitPoint, le_bool baselineIsLogicalEnd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        inline void setCursiveGlyph(le_bool baselineIsLogicalEnd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    private:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        enum EntryExitFlags
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
            EEF_HAS_ENTRY_POINT         = 0x80000000L,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            EEF_HAS_EXIT_POINT          = 0x40000000L,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            EEF_IS_CURSIVE_GLYPH        = 0x20000000L,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            EEF_BASELINE_IS_LOGICAL_END = 0x10000000L
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        le_uint32 fFlags;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        LEPoint fEntryPoint;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        LEPoint fExitPoint;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    le_int32 fGlyphCount;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    EntryExitPoint *fEntryExitPoints;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    Adjustment *fAdjustments;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    GlyphPositionAdjustments();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
public:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    GlyphPositionAdjustments(le_int32 glyphCount);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    ~GlyphPositionAdjustments();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    inline le_bool hasCursiveGlyphs() const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    inline le_bool isCursiveGlyph(le_int32 index) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    inline le_bool baselineIsLogicalEnd(le_int32 index) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    const LEPoint *getEntryPoint(le_int32 index, LEPoint &entryPoint) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    const LEPoint *getExitPoint(le_int32 index, LEPoint &exitPoint) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    inline float getXPlacement(le_int32 index) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    inline float getYPlacement(le_int32 index) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    inline float getXAdvance(le_int32 index) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    inline float getYAdvance(le_int32 index) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    inline le_int32 getBaseOffset(le_int32 index) const;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    inline void setXPlacement(le_int32 index, float newXPlacement);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    inline void setYPlacement(le_int32 index, float newYPlacement);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    inline void setXAdvance(le_int32 index, float newXAdvance);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    inline void setYAdvance(le_int32 index, float newYAdvance);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    inline void setBaseOffset(le_int32 index, le_int32 newBaseOffset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    inline void adjustXPlacement(le_int32 index, float xAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    inline void adjustYPlacement(le_int32 index, float yAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    inline void adjustXAdvance(le_int32 index, float xAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    inline void adjustYAdvance(le_int32 index, float yAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    void setEntryPoint(le_int32 index, LEPoint &newEntryPoint,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        le_bool baselineIsLogicalEnd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    void setExitPoint(le_int32 index, LEPoint &newExitPoint,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        le_bool baselineIsLogicalEnd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    void setCursiveGlyph(le_int32 index, le_bool baselineIsLogicalEnd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    void applyCursiveAdjustments(LEGlyphStorage &glyphStorage, le_bool rightToLeft,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        const LEFontInstance *fontInstance);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
inline GlyphPositionAdjustments::Adjustment::Adjustment()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
  : xPlacement(0), yPlacement(0), xAdvance(0), yAdvance(0), baseOffset(-1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    // nothing else to do!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
inline GlyphPositionAdjustments::Adjustment::Adjustment(float xPlace, float yPlace,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    float xAdv, float yAdv, le_int32 baseOff)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
  : xPlacement(xPlace), yPlacement(yPlace), xAdvance(xAdv), yAdvance(yAdv),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    baseOffset(baseOff)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    // nothing else to do!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
inline GlyphPositionAdjustments::Adjustment::~Adjustment()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    // nothing to do!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
inline float GlyphPositionAdjustments::Adjustment::getXPlacement() const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    return xPlacement;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
inline float GlyphPositionAdjustments::Adjustment::getYPlacement() const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    return yPlacement;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
inline float GlyphPositionAdjustments::Adjustment::getXAdvance() const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    return xAdvance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
inline float GlyphPositionAdjustments::Adjustment::getYAdvance() const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    return yAdvance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
inline le_int32 GlyphPositionAdjustments::Adjustment::getBaseOffset() const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    return baseOffset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
inline void GlyphPositionAdjustments::Adjustment::setXPlacement(float newXPlacement)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    xPlacement = newXPlacement;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
inline void GlyphPositionAdjustments::Adjustment::setYPlacement(float newYPlacement)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    yPlacement = newYPlacement;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
inline void GlyphPositionAdjustments::Adjustment::setXAdvance(float newXAdvance)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    xAdvance = newXAdvance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
inline void GlyphPositionAdjustments::Adjustment::setYAdvance(float newYAdvance)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    yAdvance = newYAdvance;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
inline void GlyphPositionAdjustments::Adjustment::setBaseOffset(le_int32 newBaseOffset)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    baseOffset = newBaseOffset;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
inline void GlyphPositionAdjustments::Adjustment::adjustXPlacement(float xAdjustment)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    xPlacement += xAdjustment;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
inline void GlyphPositionAdjustments::Adjustment::adjustYPlacement(float yAdjustment)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    yPlacement += yAdjustment;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
inline void GlyphPositionAdjustments::Adjustment::adjustXAdvance(float xAdjustment)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    xAdvance += xAdjustment;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
inline void GlyphPositionAdjustments::Adjustment::adjustYAdvance(float yAdjustment)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    yAdvance += yAdjustment;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
inline GlyphPositionAdjustments::EntryExitPoint::EntryExitPoint()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    : fFlags(0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    fEntryPoint.fX = fEntryPoint.fY = fExitPoint.fX = fEntryPoint.fY = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
inline GlyphPositionAdjustments::EntryExitPoint::~EntryExitPoint()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    // nothing special to do
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
inline le_bool GlyphPositionAdjustments::EntryExitPoint::isCursiveGlyph() const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    return (fFlags & EEF_IS_CURSIVE_GLYPH) != 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
inline le_bool GlyphPositionAdjustments::EntryExitPoint::baselineIsLogicalEnd() const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    return (fFlags & EEF_BASELINE_IS_LOGICAL_END) != 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
inline void GlyphPositionAdjustments::EntryExitPoint::setEntryPoint(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    LEPoint &newEntryPoint, le_bool baselineIsLogicalEnd)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    if (baselineIsLogicalEnd) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
        fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH |
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        EEF_BASELINE_IS_LOGICAL_END);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        fFlags |= (EEF_HAS_ENTRY_POINT | EEF_IS_CURSIVE_GLYPH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    fEntryPoint = newEntryPoint;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
inline void GlyphPositionAdjustments::EntryExitPoint::setExitPoint(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    LEPoint &newExitPoint, le_bool baselineIsLogicalEnd)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    if (baselineIsLogicalEnd) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH |
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
            EEF_BASELINE_IS_LOGICAL_END);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        fFlags |= (EEF_HAS_EXIT_POINT | EEF_IS_CURSIVE_GLYPH);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    fExitPoint  = newExitPoint;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
inline void GlyphPositionAdjustments::EntryExitPoint::setCursiveGlyph(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    le_bool baselineIsLogicalEnd)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    if (baselineIsLogicalEnd) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
        fFlags |= (EEF_IS_CURSIVE_GLYPH | EEF_BASELINE_IS_LOGICAL_END);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        fFlags |= EEF_IS_CURSIVE_GLYPH;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
inline le_bool GlyphPositionAdjustments::isCursiveGlyph(le_int32 index) const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    return fEntryExitPoints != NULL && fEntryExitPoints[index].isCursiveGlyph();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
inline le_bool GlyphPositionAdjustments::baselineIsLogicalEnd(le_int32 index) const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    return fEntryExitPoints != NULL && fEntryExitPoints[index].baselineIsLogicalEnd();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
inline float GlyphPositionAdjustments::getXPlacement(le_int32 index) const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
    return fAdjustments[index].getXPlacement();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
inline float GlyphPositionAdjustments::getYPlacement(le_int32 index) const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    return fAdjustments[index].getYPlacement();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
inline float GlyphPositionAdjustments::getXAdvance(le_int32 index) const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    return fAdjustments[index].getXAdvance();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
inline float GlyphPositionAdjustments::getYAdvance(le_int32 index) const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    return fAdjustments[index].getYAdvance();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
inline le_int32 GlyphPositionAdjustments::getBaseOffset(le_int32 index) const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    return fAdjustments[index].getBaseOffset();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
inline void GlyphPositionAdjustments::setXPlacement(le_int32 index, float newXPlacement)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    fAdjustments[index].setXPlacement(newXPlacement);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
inline void GlyphPositionAdjustments::setYPlacement(le_int32 index, float newYPlacement)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    fAdjustments[index].setYPlacement(newYPlacement);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
inline void GlyphPositionAdjustments::setXAdvance(le_int32 index, float newXAdvance)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
    fAdjustments[index].setXAdvance(newXAdvance);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
inline void GlyphPositionAdjustments::setYAdvance(le_int32 index, float newYAdvance)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    fAdjustments[index].setYAdvance(newYAdvance);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
inline void GlyphPositionAdjustments::setBaseOffset(le_int32 index, le_int32 newBaseOffset)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    fAdjustments[index].setBaseOffset(newBaseOffset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
inline void GlyphPositionAdjustments::adjustXPlacement(le_int32 index, float xAdjustment)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    fAdjustments[index].adjustXPlacement(xAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
inline void GlyphPositionAdjustments::adjustYPlacement(le_int32 index, float yAdjustment)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    fAdjustments[index].adjustYPlacement(yAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
inline void GlyphPositionAdjustments::adjustXAdvance(le_int32 index, float xAdjustment)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    fAdjustments[index].adjustXAdvance(xAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
inline void GlyphPositionAdjustments::adjustYAdvance(le_int32 index, float yAdjustment)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    fAdjustments[index].adjustYAdvance(yAdjustment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
inline le_bool GlyphPositionAdjustments::hasCursiveGlyphs() const
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    return fEntryExitPoints != NULL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
#endif