jdk/src/share/native/sun/font/layout/NonContextualGlyphSubstProc2.cpp
author prr
Fri, 15 Feb 2013 13:07:17 -0800
changeset 16889 3df90f344221
child 16891 91e99bed64ae
permissions -rw-r--r--
8008249: Sync ICU into JDK Reviewed-by: bae, jgodinez
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16889
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     1
/*
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     3
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Oracle designates this
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     8
 * by Oracle in the LICENSE file that accompanied this code.
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
     9
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    14
 * accompanied this code).
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    15
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    19
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    22
 * questions.
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    23
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    24
 */
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    25
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    26
/*
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    27
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    28
 * (C) Copyright IBM Corp.  and others 1998-2013 - All Rights Reserved
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    29
 *
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    30
 */
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    31
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    32
#include "LETypes.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    33
#include "MorphTables.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    34
#include "SubtableProcessor2.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    35
#include "NonContextualGlyphSubst.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    36
#include "NonContextualGlyphSubstProc2.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    37
#include "SimpleArrayProcessor2.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    38
#include "SegmentSingleProcessor2.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    39
#include "SegmentArrayProcessor2.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    40
#include "SingleTableProcessor2.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    41
#include "TrimmedArrayProcessor2.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    42
#include "LESwaps.h"
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    43
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    44
U_NAMESPACE_BEGIN
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    45
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    46
NonContextualGlyphSubstitutionProcessor2::NonContextualGlyphSubstitutionProcessor2()
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    47
{
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    48
}
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    49
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    50
NonContextualGlyphSubstitutionProcessor2::NonContextualGlyphSubstitutionProcessor2(const MorphSubtableHeader2 *morphSubtableHeader)
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    51
    : SubtableProcessor2(morphSubtableHeader)
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    52
{
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    53
}
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    54
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    55
NonContextualGlyphSubstitutionProcessor2::~NonContextualGlyphSubstitutionProcessor2()
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    56
{
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    57
}
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    58
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    59
SubtableProcessor2 *NonContextualGlyphSubstitutionProcessor2::createInstance(const MorphSubtableHeader2 *morphSubtableHeader)
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    60
{
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    61
    const NonContextualGlyphSubstitutionHeader2 *header = (const NonContextualGlyphSubstitutionHeader2 *) morphSubtableHeader;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    62
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    63
    switch (SWAPW(header->table.format))
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    64
    {
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    65
    case ltfSimpleArray:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    66
        return new SimpleArrayProcessor2(morphSubtableHeader);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    67
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    68
    case ltfSegmentSingle:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    69
        return new SegmentSingleProcessor2(morphSubtableHeader);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    70
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    71
    case ltfSegmentArray:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    72
        return new SegmentArrayProcessor2(morphSubtableHeader);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    73
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    74
    case ltfSingleTable:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    75
        return new SingleTableProcessor2(morphSubtableHeader);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    76
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    77
    case ltfTrimmedArray:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    78
        return new TrimmedArrayProcessor2(morphSubtableHeader);
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    79
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    80
    default:
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    81
        return NULL;
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    82
    }
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    83
}
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    84
3df90f344221 8008249: Sync ICU into JDK
prr
parents:
diff changeset
    85
U_NAMESPACE_END