зеркало из https://github.com/mozilla/pjs.git
bug 180266 : hard-code precompiled ccmaps. (r=shanjian, sr=alecf/rbs) : relanding
This commit is contained in:
Родитель
1f633dfbd1
Коммит
68196a10ee
|
@ -1,355 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Brian Stell <bstell@netscape.com>
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef NSCOMPRESSEDCHARMAP_H
|
||||
#define NSCOMPRESSEDCHARMAP_H
|
||||
#include "prtypes.h"
|
||||
#include "nsICharRepresentable.h"
|
||||
|
||||
#define ALU_SIZE PR_BITS_PER_LONG
|
||||
//#define ALU_SIZE 16
|
||||
//#define ALU_SIZE 32
|
||||
//#define ALU_SIZE 64
|
||||
#if (ALU_SIZE==32)
|
||||
# define ALU_TYPE PRUint32
|
||||
# define CCMAP_POW2(n) (1L<<(n))
|
||||
# define CCMAP_BITS_PER_ALU_LOG2 5
|
||||
#elif (ALU_SIZE==64)
|
||||
# define ALU_TYPE PRUint64
|
||||
# define CCMAP_POW2(n) (1L<<(n))
|
||||
# define CCMAP_BITS_PER_ALU_LOG2 6
|
||||
#else
|
||||
# define ALU_TYPE PRUint16
|
||||
# define CCMAP_POW2(n) (1<<(n))
|
||||
# define CCMAP_BITS_PER_ALU_LOG2 4
|
||||
#endif
|
||||
|
||||
|
||||
class nsICharRepresentable;
|
||||
|
||||
extern PRUint16* CreateEmptyCCMap();
|
||||
extern PRUint16* MapToCCMap(PRUint32* aMap);
|
||||
extern PRUint16* MapperToCCMap(nsICharRepresentable *aMapper);
|
||||
extern void FreeCCMap(PRUint16* &aMap);
|
||||
extern PRBool NextNonEmptyCCMapPage(PRUint16 *, PRUint32 *);
|
||||
extern PRBool IsSameCCMap(PRUint16* ccmap1, PRUint16* ccmap2);
|
||||
#ifdef DEBUG
|
||||
void printCCMap(PRUint16* aCCMap);
|
||||
#endif
|
||||
|
||||
|
||||
// surrogate support extension
|
||||
extern PRUint16*
|
||||
MapToCCMapExt(PRUint32* aBmpPlaneMap, PRUint32** aOtherPlaneMaps, PRUint32 aOtherPlaneNum);
|
||||
|
||||
//
|
||||
// nsCompressedCharMap
|
||||
//
|
||||
// A Compressed Char Map (CCMap) saves memory by folding all
|
||||
// the empty portions of the map on top of each other.
|
||||
//
|
||||
// Building a Compressed Char Map (CCMap) is more complex than
|
||||
// accessing it. We use the nsCompressedCharMap object to
|
||||
// build the CCMap. Once nsCompressedCharMap has built the CCMap
|
||||
// we get a copy of the CCMap and discard the nsCompressedCharMap
|
||||
// object. The CCMap is an array of PRUint16 and is accessed by
|
||||
// a macro.
|
||||
//
|
||||
// See "Character Map Compression" below for a discussion of
|
||||
// what the array looks like.
|
||||
|
||||
//
|
||||
// The maximum size a CCMap:
|
||||
// (16 upper pointers) + (16 empty mid pointers) +
|
||||
// (16 empty page) + (16*16 max mid pointers) +
|
||||
// (256*16 max pages) = 4400 PRUint16
|
||||
#define CCMAP_MAX_LEN (16+16+16+256+4096)
|
||||
|
||||
// non-bmp unicode support extension
|
||||
#define EXTENDED_UNICODE_PLANES 16
|
||||
|
||||
class nsCompressedCharMap {
|
||||
public:
|
||||
nsCompressedCharMap();
|
||||
~nsCompressedCharMap();
|
||||
|
||||
PRUint16* NewCCMap();
|
||||
PRUint16* FillCCMap(PRUint16* aCCMap);
|
||||
PRUint16 GetSize() {return mUsedLen;};
|
||||
void SetChar(PRUint32);
|
||||
void SetChars(PRUint16*);
|
||||
void SetChars(PRUint16, ALU_TYPE*);
|
||||
void SetChars(PRUint32*);
|
||||
void Extend() {mExtended = PR_TRUE;} // enable surrogate area
|
||||
|
||||
protected:
|
||||
union {
|
||||
PRUint16 mCCMap[CCMAP_MAX_LEN];
|
||||
ALU_TYPE used_for_align; // do not use; only here to cause
|
||||
// alignment
|
||||
} u;
|
||||
PRUint16 mUsedLen; // in PRUint16
|
||||
PRUint16 mAllOnesPage;
|
||||
|
||||
PRBool mExtended;
|
||||
|
||||
// for surrogate support
|
||||
PRUint32* mExtMap[EXTENDED_UNICODE_PLANES+1];
|
||||
PRUint32 mMap[UCS2_MAP_LEN];
|
||||
};
|
||||
|
||||
//
|
||||
// Character Map Compression
|
||||
//
|
||||
// Each font requires its own 8k charmap. On a system with 200
|
||||
// fonts this would take: 200 * 8K = 1600K memory.
|
||||
//
|
||||
// Since most char maps are mostly empty a significant amount
|
||||
// of memory can be saved by not allocating the unused sections.
|
||||
//
|
||||
// If the map has one or more levels of indirection then the
|
||||
// the empty sections of the map can all be folded to a single
|
||||
// common empty element. In this way only the non-empty sections
|
||||
// need space. Because the empty sections actually point to a
|
||||
// common empty section every entry in the map can be valid
|
||||
// without requiring actually allocating space.
|
||||
// Some larger CJK fonts have large sections where every bit
|
||||
// is set. In the same way that the empty sections are folded
|
||||
// onto one "empty page", the sections where all bits are set are
|
||||
// folded on to one "all bits set page" .
|
||||
//
|
||||
// Break up the Unicode range bits 0x0000 - 0xFFFF
|
||||
// into 3 bit ranges:
|
||||
//
|
||||
// upper bits: bit15 - bit12
|
||||
// mid bits: bit11 - bit8
|
||||
// page bits: bit7 - bit0
|
||||
//
|
||||
// within a page, (assumming a 4 byte ALU)
|
||||
// bits 7-5 select one of the 8 longs
|
||||
// bits 4-0 select one of the 32 bits within the long
|
||||
//
|
||||
// There is exactly one upper "pointers" array.
|
||||
//
|
||||
// The upper pointers each point to a mid array. If there are no chars
|
||||
// in an upper pointer's block that pointer points to the empty mid.
|
||||
// Thus all upper pointers are "valid" even if they do not have space
|
||||
// allocated; eg: the accessor macro does not need to test if the
|
||||
// pointer is zero.
|
||||
//
|
||||
// Each mid pointer in the mid array points to a page. If there are no
|
||||
// chars in a mid pointer's page that pointer points to the empty page.
|
||||
// Thus all mid pointers are "valid" even if they do not have space
|
||||
// allocated; eg: the accessor macro does not need to test if the
|
||||
// pointer is zero.
|
||||
//
|
||||
// Since the array will be less than 5K PRUint16 the "pointers" can
|
||||
// be implemented as 2 byte offsets from the base instead of
|
||||
// real pointers.
|
||||
//
|
||||
// the format of the CCMap is
|
||||
// the upper pointers (16 PRUint16)
|
||||
// the empty mid pointers (16 PRUint16)
|
||||
// the empty page (16 PRUint16)
|
||||
// non-empty mid pointers and pages as needed
|
||||
|
||||
// One minor note: for a completely empty map it is actually
|
||||
// possible to fold the upper, empty mid, and empty page
|
||||
// on top of each other and make a map of only 32 bytes.
|
||||
#define CCMAP_EMPTY_SIZE_PER_INT16 16
|
||||
|
||||
// offsets to the empty mid and empty page
|
||||
#define CCMAP_EMPTY_MID CCMAP_NUM_UPPER_POINTERS
|
||||
#define CCMAP_EMPTY_PAGE CCMAP_EMPTY_MID+CCMAP_NUM_MID_POINTERS
|
||||
|
||||
//
|
||||
// Because the table is offset based the code can build the table in a
|
||||
// temp space (max table size on the stack) and then do one alloc of
|
||||
// the actual needed size and simply copy over the data.
|
||||
//
|
||||
|
||||
//
|
||||
// Compressed Char map surrogate extension
|
||||
//
|
||||
// The design goal of surrogate support extension is to keep efficiency
|
||||
// and compatibility of existing compressed charmap operations. Most of
|
||||
// existing operation are untouched. For BMP support, very little memory
|
||||
// overhead (4 bytes) is added. Runtime efficiency of BMP support is
|
||||
// unchanged.
|
||||
//
|
||||
// structure of extended charmap:
|
||||
// ccmap flag 1 PRUint16 , indication if this is extended one or not
|
||||
// bmp ccmap size 1 PRUint16 , the size of BMP ccmap,
|
||||
// BMP ccmap size varies,
|
||||
// plane index 16 PRUint32, use to index ccmap for non-BMP plane
|
||||
// empty ccmap 16 PRUint16, a total empty ccmap
|
||||
// non-BMP ccmaps size varies, other non-empty, non-BMP ccmap
|
||||
//
|
||||
// Changes to basic ccmap
|
||||
// 2 PRUint16 are added in the very beginning. One is used to descript the size
|
||||
// of the ccmap, the other is used as a flag. But these 2 fields are indexed
|
||||
// negatively so that all other operation remain unchanged to keep efficiency.
|
||||
// ccmap memory allocation is moved from nsCompressedCharMap::NewCCMap to
|
||||
// MapToCCMap.
|
||||
//
|
||||
// Extended ccmap
|
||||
// A 16*PRUint32 array was put at the end of basic ccmap, each PRUint32 either
|
||||
// pointed to the empty ccmap or a independent plane ccmap. Directly after this
|
||||
// array is a empty ccmap. All planes that has no character will share this ccmap.
|
||||
// All non-empty plane will have a ccmap.
|
||||
// "MapToCCMapExt" is added to created an extended ccmap, each plane ccmap is
|
||||
// created the same as basic one, but without 2 additional fields.
|
||||
// "HasGlyphExt" is used to access extended ccmap, it first need to locate the
|
||||
// plane ccmap, and then operated the same way as "HasGlyph".
|
||||
//
|
||||
// Compatibility between old and new one
|
||||
// Because extended ccmap include an exactly identical basic ccmap in its head,
|
||||
// basic ccmap operation (HasGlyph) can be applied on extended ccmap without
|
||||
// problem.
|
||||
// Because basic ccmap is now have a flag to indicate if it is a extended one,
|
||||
// Extended ccmap operation (HasGlyphExt) can check the flag before it does
|
||||
// extended ccmap specific operation. So HasGlyphExt can be applied to basic ccmap
|
||||
// too.
|
||||
//
|
||||
|
||||
// Page bits
|
||||
//
|
||||
#define CCMAP_BITS_PER_PAGE_LOG2 8
|
||||
#define CCMAP_BITS_PER_PAGE CCMAP_POW2(CCMAP_BITS_PER_PAGE_LOG2)
|
||||
#define CCMAP_BIT_INDEX(c) ((c) & PR_BITMASK(CCMAP_BITS_PER_ALU_LOG2))
|
||||
#define CCMAP_ALU_INDEX(c) (((c)>>CCMAP_BITS_PER_ALU_LOG2) \
|
||||
& PR_BITMASK(CCMAP_BITS_PER_PAGE_LOG2 - CCMAP_BITS_PER_ALU_LOG2))
|
||||
|
||||
#define CCMAP_PAGE_MASK PR_BITMASK(CCMAP_BITS_PER_PAGE_LOG2)
|
||||
#define CCMAP_NUM_PRUINT16S_PER_PAGE \
|
||||
(CCMAP_BITS_PER_PAGE/CCMAP_BITS_PER_PRUINT16)
|
||||
// one bit per char
|
||||
#define CCMAP_NUM_ALUS_PER_PAGE (CCMAP_BITS_PER_PAGE/CCMAP_BITS_PER_ALU)
|
||||
#define CCMAP_NUM_UCHARS_PER_PAGE CCMAP_BITS_PER_PAGE
|
||||
|
||||
//
|
||||
// Mid bits
|
||||
//
|
||||
#define CCMAP_BITS_PER_MID_LOG2 4
|
||||
#define CCMAP_MID_INDEX(c) \
|
||||
(((c)>>CCMAP_BITS_PER_PAGE_LOG2) & PR_BITMASK(CCMAP_BITS_PER_MID_LOG2))
|
||||
#define CCMAP_NUM_MID_POINTERS CCMAP_POW2(CCMAP_BITS_PER_MID_LOG2)
|
||||
#define CCMAP_NUM_UCHARS_PER_MID \
|
||||
CCMAP_POW2(CCMAP_BITS_PER_MID_LOG2+CCMAP_BITS_PER_PAGE_LOG2)
|
||||
|
||||
//
|
||||
// Upper bits
|
||||
//
|
||||
#define CCMAP_BITS_PER_UPPER_LOG2 4
|
||||
#define CCMAP_UPPER_INDEX(c) \
|
||||
(((c)>>(CCMAP_BITS_PER_MID_LOG2+CCMAP_BITS_PER_PAGE_LOG2)) \
|
||||
& PR_BITMASK(CCMAP_BITS_PER_UPPER_LOG2))
|
||||
#define CCMAP_NUM_UPPER_POINTERS CCMAP_POW2(CCMAP_BITS_PER_UPPER_LOG2)
|
||||
|
||||
//
|
||||
// Misc
|
||||
//
|
||||
#define CCMAP_BITS_PER_PRUINT16_LOG2 4
|
||||
#define CCMAP_BITS_PER_PRUINT32_LOG2 5
|
||||
|
||||
#define CCMAP_BITS_PER_PRUINT16 CCMAP_POW2(CCMAP_BITS_PER_PRUINT16_LOG2)
|
||||
#define CCMAP_BITS_PER_PRUINT32 CCMAP_POW2(CCMAP_BITS_PER_PRUINT32_LOG2)
|
||||
#define CCMAP_BITS_PER_ALU CCMAP_POW2(CCMAP_BITS_PER_ALU_LOG2)
|
||||
|
||||
#define CCMAP_ALUS_PER_PRUINT32 (CCMAP_BITS_PER_PRUINT32/CCMAP_BITS_PER_ALU)
|
||||
#define CCMAP_PRUINT32S_PER_ALU (CCMAP_BITS_PER_ALU/CCMAP_BITS_PER_PRUINT32)
|
||||
#define CCMAP_PRUINT32S_PER_PAGE (CCMAP_BITS_PER_PAGE/CCMAP_BITS_PER_PRUINT32)
|
||||
|
||||
#define CCMAP_ALU_MASK PR_BITMASK(CCMAP_BITS_PER_ALU)
|
||||
#define CCMAP_ALUS_PER_PAGE CCMAP_POW2(CCMAP_BITS_PER_PAGE_LOG2 \
|
||||
- CCMAP_BITS_PER_ALU_LOG2)
|
||||
#define NUM_UNICODE_CHARS CCMAP_POW2(CCMAP_BITS_PER_UPPER_LOG2 \
|
||||
+CCMAP_BITS_PER_MID_LOG2 \
|
||||
+CCMAP_BITS_PER_PAGE_LOG2)
|
||||
#define CCMAP_TOTAL_PAGES CCMAP_POW2(CCMAP_BITS_PER_UPPER_LOG2 \
|
||||
+CCMAP_BITS_PER_MID_LOG2)
|
||||
|
||||
#define CCMAP_BEGIN_AT_START_OF_MAP 0xFFFFFFFF
|
||||
|
||||
//
|
||||
// Finally, build up the macro to test the bit for a given char
|
||||
//
|
||||
|
||||
// offset from base to mid array
|
||||
#define CCMAP_TO_MID(m,c) ((m)[CCMAP_UPPER_INDEX(c)])
|
||||
|
||||
// offset from base to page
|
||||
#define CCMAP_TO_PAGE(m,c) ((m)[CCMAP_TO_MID((m),(c)) + CCMAP_MID_INDEX(c)])
|
||||
|
||||
// offset from base to alu
|
||||
#define CCMAP_TO_ALU(m,c) \
|
||||
(*((ALU_TYPE*)(&((m)[CCMAP_TO_PAGE((m),(c))])) + CCMAP_ALU_INDEX(c)))
|
||||
|
||||
// test the bit
|
||||
#define CCMAP_HAS_CHAR(m,c) (((CCMAP_TO_ALU(m,c))>>CCMAP_BIT_INDEX(c)) & 1)
|
||||
|
||||
// unset the bit
|
||||
#define CCMAP_UNSET_CHAR(m,c) (CCMAP_TO_ALU(m,c) &= ~(CCMAP_POW2(CCMAP_BIT_INDEX(c))))
|
||||
|
||||
#define CCMAP_SIZE(m) (*((m)-1))
|
||||
#define CCMAP_FLAG(m) (*((m)-2))
|
||||
#define CCMAP_EXTRA (sizeof(ALU_TYPE)/sizeof(PRUint16)>2? sizeof(ALU_TYPE)/sizeof(PRUint16): 2)
|
||||
#define CCMAP_SURROGATE_FLAG 0x0001
|
||||
#define CCMAP_NONE_FLAG 0x0000
|
||||
|
||||
// get plane number from ccmap, bmp excluded, so plane 1's number is 0.
|
||||
#define CCMAP_PLANE_FROM_SURROGATE(h) ((((PRUint16)(h) - (PRUint16)0xd800) >> 6) + 1)
|
||||
|
||||
// same as above, but get plane number from a ucs4 char
|
||||
#define CCMAP_PLANE(u) ((((PRUint32)(u))>>16))
|
||||
|
||||
// scalar value inside the plane
|
||||
#define CCMAP_INPLANE_OFFSET(h, l) (((((PRUint16)(h) - (PRUint16)0xd800) & 0x3f) << 10) + ((PRUint16)(l) - (PRUint16)0xdc00))
|
||||
|
||||
// get ccmap for that plane
|
||||
#define CCMAP_FOR_PLANE_EXT(m, i) ((m) + ((PRUint32*)((m) + CCMAP_SIZE(m)))[(i)-1])
|
||||
|
||||
// test the bit for surrogate pair
|
||||
#define CCMAP_HAS_CHAR_EXT2(m, h, l) (CCMAP_FLAG(m) & CCMAP_SURROGATE_FLAG && \
|
||||
CCMAP_HAS_CHAR(CCMAP_FOR_PLANE_EXT((m), CCMAP_PLANE_FROM_SURROGATE(h)), CCMAP_INPLANE_OFFSET(h, l)))
|
||||
// test the bit for a character in UCS4
|
||||
#define CCMAP_HAS_CHAR_EXT(m, ucs4) (((ucs4)&0xffff0000) ? \
|
||||
(CCMAP_FLAG(m) & CCMAP_SURROGATE_FLAG) && CCMAP_HAS_CHAR(CCMAP_FOR_PLANE_EXT((m), CCMAP_PLANE(ucs4)), (ucs4) & 0xffff) : \
|
||||
CCMAP_HAS_CHAR(m, (PRUnichar)(ucs4)) )
|
||||
#endif // NSCOMPRESSEDCHARMAP_H
|
|
@ -627,42 +627,16 @@ atomToName(nsIAtom* aAtom)
|
|||
|
||||
static PRUint16* gUserDefinedCCMap = nsnull;
|
||||
static PRUint16* gEmptyCCMap = nsnull;
|
||||
static PRUint16* gDoubleByteSpecialCharsCCMap = nsnull;
|
||||
|
||||
//
|
||||
// smart quotes (and other special chars) in Asian (double byte)
|
||||
// fonts are too large to use is western fonts.
|
||||
// Here we define those characters.
|
||||
// XXX: This array can (and need, for performance) be made |const| when
|
||||
// GTK port of gfx gets sync'd with Xlib port for multiple device contexts.
|
||||
//
|
||||
static const PRUnichar gDoubleByteSpecialChars[] = {
|
||||
0x0152, /* LATIN CAPITAL LIGATURE OE */
|
||||
0x0153, /* LATIN SMALL LIGATURE OE */
|
||||
0x0160, /* LATIN CAPITAL LETTER S WITH CARON */
|
||||
0x0161, /* LATIN SMALL LETTER S WITH CARON */
|
||||
0x0178, /* LATIN CAPITAL LETTER Y WITH DIAERESIS */
|
||||
0x017D, /* LATIN CAPITAL LETTER Z WITH CARON */
|
||||
0x017E, /* LATIN SMALL LETTER Z WITH CARON */
|
||||
0x0192, /* LATIN SMALL LETTER F WITH HOOK */
|
||||
0x02C6, /* MODIFIER LETTER CIRCUMFLEX ACCENT */
|
||||
0x02DC, /* SMALL TILDE */
|
||||
0x2013, /* EN DASH */
|
||||
0x2014, /* EM DASH */
|
||||
0x2018, /* LEFT SINGLE QUOTATION MARK */
|
||||
0x2019, /* RIGHT SINGLE QUOTATION MARK */
|
||||
0x201A, /* SINGLE LOW-9 QUOTATION MARK */
|
||||
0x201C, /* LEFT DOUBLE QUOTATION MARK */
|
||||
0x201D, /* RIGHT DOUBLE QUOTATION MARK */
|
||||
0x201E, /* DOUBLE LOW-9 QUOTATION MARK */
|
||||
0x2020, /* DAGGER */
|
||||
0x2021, /* DOUBLE DAGGER */
|
||||
0x2022, /* BULLET */
|
||||
0x2026, /* HORIZONTAL ELLIPSIS */
|
||||
0x2030, /* PER MILLE SIGN */
|
||||
0x2039, /* SINGLE LEFT-POINTING ANGLE QUOTATION MARK */
|
||||
0x203A, /* SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */
|
||||
0x20AC, /* EURO SIGN */
|
||||
0x2122, /* TRADE MARK SIGN */
|
||||
0
|
||||
static PRUint16 gDoubleByteSpecialCharsCCMap[] = {
|
||||
#include "dbyte_special_chars.ccmap"
|
||||
};
|
||||
|
||||
|
||||
|
@ -849,7 +823,6 @@ FreeGlobals(void)
|
|||
}
|
||||
FreeCCMap(gUserDefinedCCMap);
|
||||
FreeCCMap(gEmptyCCMap);
|
||||
FreeCCMap(gDoubleByteSpecialCharsCCMap);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -893,15 +866,6 @@ InitGlobals(nsIDeviceContext *aDevice)
|
|||
if (NS_SUCCEEDED(rv))
|
||||
gAllowDoubleByteSpecialChars = val;
|
||||
|
||||
// setup the double byte font special chars glyph map
|
||||
nsCompressedCharMap specialchars_ccmapObj;
|
||||
for (int i=0; gDoubleByteSpecialChars[i]; i++) {
|
||||
specialchars_ccmapObj.SetChar(gDoubleByteSpecialChars[i]);
|
||||
}
|
||||
gDoubleByteSpecialCharsCCMap = specialchars_ccmapObj.NewCCMap();
|
||||
if (!gDoubleByteSpecialCharsCCMap)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
PRInt32 scale_minimum = 0;
|
||||
rv = gPref->GetIntPref("font.scale.outline.min", &scale_minimum);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
@ -2253,8 +2217,15 @@ SetUpFontCharSetInfo(nsFontCharSetInfo* aSelf)
|
|||
if ((aSelf->Convert == DoubleByteConvert)
|
||||
&& (!gAllowDoubleByteSpecialChars)) {
|
||||
PRUint16* ccmap = aSelf->mCCMap;
|
||||
for (int i=0; gDoubleByteSpecialChars[i]; i++) {
|
||||
CCMAP_UNSET_CHAR(ccmap, gDoubleByteSpecialChars[i]);
|
||||
PRUint32 page = CCMAP_BEGIN_AT_START_OF_MAP;
|
||||
const PRUint16* specialmap = gDoubleByteSpecialCharsCCMap;
|
||||
while (NextNonEmptyCCMapPage(specialmap, &page)) {
|
||||
PRUint32 pagechar = page;
|
||||
for (int i=0; i < CCMAP_BITS_PER_PAGE; i++) {
|
||||
if (CCMAP_HAS_CHAR(specialmap, pagechar))
|
||||
CCMAP_UNSET_CHAR(ccmap, pagechar);
|
||||
pagechar++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return PR_TRUE;
|
||||
|
|
|
@ -111,13 +111,13 @@ MapperToCCMap(nsICharRepresentable *aMapper)
|
|||
}
|
||||
|
||||
PRBool
|
||||
NextNonEmptyCCMapPage(PRUint16* aCCMap, PRUint32 *aPageStart)
|
||||
NextNonEmptyCCMapPage(const PRUint16* aCCMap, PRUint32 *aPageStart)
|
||||
{
|
||||
int i, j, l;
|
||||
int planeend = 0;
|
||||
int planestart = 0;
|
||||
unsigned int k;
|
||||
PRUint16* ccmap;
|
||||
const PRUint16* ccmap;
|
||||
PRUint32 pagestart = *aPageStart;
|
||||
|
||||
if(CCMAP_FLAG(aCCMap) & CCMAP_SURROGATE_FLAG) {
|
||||
|
@ -154,20 +154,20 @@ NextNonEmptyCCMapPage(PRUint16* aCCMap, PRUint32 *aPageStart)
|
|||
}
|
||||
|
||||
// walk thru the upper pointers
|
||||
PRUint16 *upper = &ccmap[0];
|
||||
const PRUint16 *upper = &ccmap[0];
|
||||
for (i=upper_index; i<CCMAP_NUM_UPPER_POINTERS; i++, mid_index=0) {
|
||||
if (upper[i] == CCMAP_EMPTY_MID) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// walk the mid array
|
||||
PRUint16 *mid = &ccmap[upper[i]];
|
||||
const PRUint16 *mid = &ccmap[upper[i]];
|
||||
for (j=mid_index; j<CCMAP_NUM_MID_POINTERS; j++) {
|
||||
if (mid[j] == CCMAP_EMPTY_PAGE)
|
||||
continue;
|
||||
|
||||
// walk the page
|
||||
ALU_TYPE *page = (ALU_TYPE*)&ccmap[mid[j]];
|
||||
const ALU_TYPE *page = (ALU_TYPE*)&ccmap[mid[j]];
|
||||
for (k=0; k<CCMAP_NUM_ALUS_PER_PAGE; k++) {
|
||||
if (page[k] != 0) {
|
||||
PRUint32 base = (i*CCMAP_NUM_UCHARS_PER_MID) + (j*CCMAP_NUM_UCHARS_PER_PAGE);
|
||||
|
|
|
@ -1,355 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Brian Stell <bstell@netscape.com>
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef NSCOMPRESSEDCHARMAP_H
|
||||
#define NSCOMPRESSEDCHARMAP_H
|
||||
#include "prtypes.h"
|
||||
#include "nsICharRepresentable.h"
|
||||
|
||||
#define ALU_SIZE PR_BITS_PER_LONG
|
||||
//#define ALU_SIZE 16
|
||||
//#define ALU_SIZE 32
|
||||
//#define ALU_SIZE 64
|
||||
#if (ALU_SIZE==32)
|
||||
# define ALU_TYPE PRUint32
|
||||
# define CCMAP_POW2(n) (1L<<(n))
|
||||
# define CCMAP_BITS_PER_ALU_LOG2 5
|
||||
#elif (ALU_SIZE==64)
|
||||
# define ALU_TYPE PRUint64
|
||||
# define CCMAP_POW2(n) (1L<<(n))
|
||||
# define CCMAP_BITS_PER_ALU_LOG2 6
|
||||
#else
|
||||
# define ALU_TYPE PRUint16
|
||||
# define CCMAP_POW2(n) (1<<(n))
|
||||
# define CCMAP_BITS_PER_ALU_LOG2 4
|
||||
#endif
|
||||
|
||||
|
||||
class nsICharRepresentable;
|
||||
|
||||
extern PRUint16* CreateEmptyCCMap();
|
||||
extern PRUint16* MapToCCMap(PRUint32* aMap);
|
||||
extern PRUint16* MapperToCCMap(nsICharRepresentable *aMapper);
|
||||
extern void FreeCCMap(PRUint16* &aMap);
|
||||
extern PRBool NextNonEmptyCCMapPage(PRUint16 *, PRUint32 *);
|
||||
extern PRBool IsSameCCMap(PRUint16* ccmap1, PRUint16* ccmap2);
|
||||
#ifdef DEBUG
|
||||
void printCCMap(PRUint16* aCCMap);
|
||||
#endif
|
||||
|
||||
|
||||
// surrogate support extension
|
||||
extern PRUint16*
|
||||
MapToCCMapExt(PRUint32* aBmpPlaneMap, PRUint32** aOtherPlaneMaps, PRUint32 aOtherPlaneNum);
|
||||
|
||||
//
|
||||
// nsCompressedCharMap
|
||||
//
|
||||
// A Compressed Char Map (CCMap) saves memory by folding all
|
||||
// the empty portions of the map on top of each other.
|
||||
//
|
||||
// Building a Compressed Char Map (CCMap) is more complex than
|
||||
// accessing it. We use the nsCompressedCharMap object to
|
||||
// build the CCMap. Once nsCompressedCharMap has built the CCMap
|
||||
// we get a copy of the CCMap and discard the nsCompressedCharMap
|
||||
// object. The CCMap is an array of PRUint16 and is accessed by
|
||||
// a macro.
|
||||
//
|
||||
// See "Character Map Compression" below for a discussion of
|
||||
// what the array looks like.
|
||||
|
||||
//
|
||||
// The maximum size a CCMap:
|
||||
// (16 upper pointers) + (16 empty mid pointers) +
|
||||
// (16 empty page) + (16*16 max mid pointers) +
|
||||
// (256*16 max pages) = 4400 PRUint16
|
||||
#define CCMAP_MAX_LEN (16+16+16+256+4096)
|
||||
|
||||
// non-bmp unicode support extension
|
||||
#define EXTENDED_UNICODE_PLANES 16
|
||||
|
||||
class nsCompressedCharMap {
|
||||
public:
|
||||
nsCompressedCharMap();
|
||||
~nsCompressedCharMap();
|
||||
|
||||
PRUint16* NewCCMap();
|
||||
PRUint16* FillCCMap(PRUint16* aCCMap);
|
||||
PRUint16 GetSize() {return mUsedLen;};
|
||||
void SetChar(PRUint32);
|
||||
void SetChars(PRUint16*);
|
||||
void SetChars(PRUint16, ALU_TYPE*);
|
||||
void SetChars(PRUint32*);
|
||||
void Extend() {mExtended = PR_TRUE;} // enable surrogate area
|
||||
|
||||
protected:
|
||||
union {
|
||||
PRUint16 mCCMap[CCMAP_MAX_LEN];
|
||||
ALU_TYPE used_for_align; // do not use; only here to cause
|
||||
// alignment
|
||||
} u;
|
||||
PRUint16 mUsedLen; // in PRUint16
|
||||
PRUint16 mAllOnesPage;
|
||||
|
||||
PRBool mExtended;
|
||||
|
||||
// for surrogate support
|
||||
PRUint32* mExtMap[EXTENDED_UNICODE_PLANES+1];
|
||||
PRUint32 mMap[UCS2_MAP_LEN];
|
||||
};
|
||||
|
||||
//
|
||||
// Character Map Compression
|
||||
//
|
||||
// Each font requires its own 8k charmap. On a system with 200
|
||||
// fonts this would take: 200 * 8K = 1600K memory.
|
||||
//
|
||||
// Since most char maps are mostly empty a significant amount
|
||||
// of memory can be saved by not allocating the unused sections.
|
||||
//
|
||||
// If the map has one or more levels of indirection then the
|
||||
// the empty sections of the map can all be folded to a single
|
||||
// common empty element. In this way only the non-empty sections
|
||||
// need space. Because the empty sections actually point to a
|
||||
// common empty section every entry in the map can be valid
|
||||
// without requiring actually allocating space.
|
||||
// Some larger CJK fonts have large sections where every bit
|
||||
// is set. In the same way that the empty sections are folded
|
||||
// onto one "empty page", the sections where all bits are set are
|
||||
// folded on to one "all bits set page" .
|
||||
//
|
||||
// Break up the Unicode range bits 0x0000 - 0xFFFF
|
||||
// into 3 bit ranges:
|
||||
//
|
||||
// upper bits: bit15 - bit12
|
||||
// mid bits: bit11 - bit8
|
||||
// page bits: bit7 - bit0
|
||||
//
|
||||
// within a page, (assumming a 4 byte ALU)
|
||||
// bits 7-5 select one of the 8 longs
|
||||
// bits 4-0 select one of the 32 bits within the long
|
||||
//
|
||||
// There is exactly one upper "pointers" array.
|
||||
//
|
||||
// The upper pointers each point to a mid array. If there are no chars
|
||||
// in an upper pointer's block that pointer points to the empty mid.
|
||||
// Thus all upper pointers are "valid" even if they do not have space
|
||||
// allocated; eg: the accessor macro does not need to test if the
|
||||
// pointer is zero.
|
||||
//
|
||||
// Each mid pointer in the mid array points to a page. If there are no
|
||||
// chars in a mid pointer's page that pointer points to the empty page.
|
||||
// Thus all mid pointers are "valid" even if they do not have space
|
||||
// allocated; eg: the accessor macro does not need to test if the
|
||||
// pointer is zero.
|
||||
//
|
||||
// Since the array will be less than 5K PRUint16 the "pointers" can
|
||||
// be implemented as 2 byte offsets from the base instead of
|
||||
// real pointers.
|
||||
//
|
||||
// the format of the CCMap is
|
||||
// the upper pointers (16 PRUint16)
|
||||
// the empty mid pointers (16 PRUint16)
|
||||
// the empty page (16 PRUint16)
|
||||
// non-empty mid pointers and pages as needed
|
||||
|
||||
// One minor note: for a completely empty map it is actually
|
||||
// possible to fold the upper, empty mid, and empty page
|
||||
// on top of each other and make a map of only 32 bytes.
|
||||
#define CCMAP_EMPTY_SIZE_PER_INT16 16
|
||||
|
||||
// offsets to the empty mid and empty page
|
||||
#define CCMAP_EMPTY_MID CCMAP_NUM_UPPER_POINTERS
|
||||
#define CCMAP_EMPTY_PAGE CCMAP_EMPTY_MID+CCMAP_NUM_MID_POINTERS
|
||||
|
||||
//
|
||||
// Because the table is offset based the code can build the table in a
|
||||
// temp space (max table size on the stack) and then do one alloc of
|
||||
// the actual needed size and simply copy over the data.
|
||||
//
|
||||
|
||||
//
|
||||
// Compressed Char map surrogate extension
|
||||
//
|
||||
// The design goal of surrogate support extension is to keep efficiency
|
||||
// and compatibility of existing compressed charmap operations. Most of
|
||||
// existing operation are untouched. For BMP support, very little memory
|
||||
// overhead (4 bytes) is added. Runtime efficiency of BMP support is
|
||||
// unchanged.
|
||||
//
|
||||
// structure of extended charmap:
|
||||
// ccmap flag 1 PRUint16 , indication if this is extended one or not
|
||||
// bmp ccmap size 1 PRUint16 , the size of BMP ccmap,
|
||||
// BMP ccmap size varies,
|
||||
// plane index 16 PRUint32, use to index ccmap for non-BMP plane
|
||||
// empty ccmap 16 PRUint16, a total empty ccmap
|
||||
// non-BMP ccmaps size varies, other non-empty, non-BMP ccmap
|
||||
//
|
||||
// Changes to basic ccmap
|
||||
// 2 PRUint16 are added in the very beginning. One is used to descript the size
|
||||
// of the ccmap, the other is used as a flag. But these 2 fields are indexed
|
||||
// negatively so that all other operation remain unchanged to keep efficiency.
|
||||
// ccmap memory allocation is moved from nsCompressedCharMap::NewCCMap to
|
||||
// MapToCCMap.
|
||||
//
|
||||
// Extended ccmap
|
||||
// A 16*PRUint32 array was put at the end of basic ccmap, each PRUint32 either
|
||||
// pointed to the empty ccmap or a independent plane ccmap. Directly after this
|
||||
// array is a empty ccmap. All planes that has no character will share this ccmap.
|
||||
// All non-empty plane will have a ccmap.
|
||||
// "MapToCCMapExt" is added to created an extended ccmap, each plane ccmap is
|
||||
// created the same as basic one, but without 2 additional fields.
|
||||
// "HasGlyphExt" is used to access extended ccmap, it first need to locate the
|
||||
// plane ccmap, and then operated the same way as "HasGlyph".
|
||||
//
|
||||
// Compatibility between old and new one
|
||||
// Because extended ccmap include an exactly identical basic ccmap in its head,
|
||||
// basic ccmap operation (HasGlyph) can be applied on extended ccmap without
|
||||
// problem.
|
||||
// Because basic ccmap is now have a flag to indicate if it is a extended one,
|
||||
// Extended ccmap operation (HasGlyphExt) can check the flag before it does
|
||||
// extended ccmap specific operation. So HasGlyphExt can be applied to basic ccmap
|
||||
// too.
|
||||
//
|
||||
|
||||
// Page bits
|
||||
//
|
||||
#define CCMAP_BITS_PER_PAGE_LOG2 8
|
||||
#define CCMAP_BITS_PER_PAGE CCMAP_POW2(CCMAP_BITS_PER_PAGE_LOG2)
|
||||
#define CCMAP_BIT_INDEX(c) ((c) & PR_BITMASK(CCMAP_BITS_PER_ALU_LOG2))
|
||||
#define CCMAP_ALU_INDEX(c) (((c)>>CCMAP_BITS_PER_ALU_LOG2) \
|
||||
& PR_BITMASK(CCMAP_BITS_PER_PAGE_LOG2 - CCMAP_BITS_PER_ALU_LOG2))
|
||||
|
||||
#define CCMAP_PAGE_MASK PR_BITMASK(CCMAP_BITS_PER_PAGE_LOG2)
|
||||
#define CCMAP_NUM_PRUINT16S_PER_PAGE \
|
||||
(CCMAP_BITS_PER_PAGE/CCMAP_BITS_PER_PRUINT16)
|
||||
// one bit per char
|
||||
#define CCMAP_NUM_ALUS_PER_PAGE (CCMAP_BITS_PER_PAGE/CCMAP_BITS_PER_ALU)
|
||||
#define CCMAP_NUM_UCHARS_PER_PAGE CCMAP_BITS_PER_PAGE
|
||||
|
||||
//
|
||||
// Mid bits
|
||||
//
|
||||
#define CCMAP_BITS_PER_MID_LOG2 4
|
||||
#define CCMAP_MID_INDEX(c) \
|
||||
(((c)>>CCMAP_BITS_PER_PAGE_LOG2) & PR_BITMASK(CCMAP_BITS_PER_MID_LOG2))
|
||||
#define CCMAP_NUM_MID_POINTERS CCMAP_POW2(CCMAP_BITS_PER_MID_LOG2)
|
||||
#define CCMAP_NUM_UCHARS_PER_MID \
|
||||
CCMAP_POW2(CCMAP_BITS_PER_MID_LOG2+CCMAP_BITS_PER_PAGE_LOG2)
|
||||
|
||||
//
|
||||
// Upper bits
|
||||
//
|
||||
#define CCMAP_BITS_PER_UPPER_LOG2 4
|
||||
#define CCMAP_UPPER_INDEX(c) \
|
||||
(((c)>>(CCMAP_BITS_PER_MID_LOG2+CCMAP_BITS_PER_PAGE_LOG2)) \
|
||||
& PR_BITMASK(CCMAP_BITS_PER_UPPER_LOG2))
|
||||
#define CCMAP_NUM_UPPER_POINTERS CCMAP_POW2(CCMAP_BITS_PER_UPPER_LOG2)
|
||||
|
||||
//
|
||||
// Misc
|
||||
//
|
||||
#define CCMAP_BITS_PER_PRUINT16_LOG2 4
|
||||
#define CCMAP_BITS_PER_PRUINT32_LOG2 5
|
||||
|
||||
#define CCMAP_BITS_PER_PRUINT16 CCMAP_POW2(CCMAP_BITS_PER_PRUINT16_LOG2)
|
||||
#define CCMAP_BITS_PER_PRUINT32 CCMAP_POW2(CCMAP_BITS_PER_PRUINT32_LOG2)
|
||||
#define CCMAP_BITS_PER_ALU CCMAP_POW2(CCMAP_BITS_PER_ALU_LOG2)
|
||||
|
||||
#define CCMAP_ALUS_PER_PRUINT32 (CCMAP_BITS_PER_PRUINT32/CCMAP_BITS_PER_ALU)
|
||||
#define CCMAP_PRUINT32S_PER_ALU (CCMAP_BITS_PER_ALU/CCMAP_BITS_PER_PRUINT32)
|
||||
#define CCMAP_PRUINT32S_PER_PAGE (CCMAP_BITS_PER_PAGE/CCMAP_BITS_PER_PRUINT32)
|
||||
|
||||
#define CCMAP_ALU_MASK PR_BITMASK(CCMAP_BITS_PER_ALU)
|
||||
#define CCMAP_ALUS_PER_PAGE CCMAP_POW2(CCMAP_BITS_PER_PAGE_LOG2 \
|
||||
- CCMAP_BITS_PER_ALU_LOG2)
|
||||
#define NUM_UNICODE_CHARS CCMAP_POW2(CCMAP_BITS_PER_UPPER_LOG2 \
|
||||
+CCMAP_BITS_PER_MID_LOG2 \
|
||||
+CCMAP_BITS_PER_PAGE_LOG2)
|
||||
#define CCMAP_TOTAL_PAGES CCMAP_POW2(CCMAP_BITS_PER_UPPER_LOG2 \
|
||||
+CCMAP_BITS_PER_MID_LOG2)
|
||||
|
||||
#define CCMAP_BEGIN_AT_START_OF_MAP 0xFFFFFFFF
|
||||
|
||||
//
|
||||
// Finally, build up the macro to test the bit for a given char
|
||||
//
|
||||
|
||||
// offset from base to mid array
|
||||
#define CCMAP_TO_MID(m,c) ((m)[CCMAP_UPPER_INDEX(c)])
|
||||
|
||||
// offset from base to page
|
||||
#define CCMAP_TO_PAGE(m,c) ((m)[CCMAP_TO_MID((m),(c)) + CCMAP_MID_INDEX(c)])
|
||||
|
||||
// offset from base to alu
|
||||
#define CCMAP_TO_ALU(m,c) \
|
||||
(*((ALU_TYPE*)(&((m)[CCMAP_TO_PAGE((m),(c))])) + CCMAP_ALU_INDEX(c)))
|
||||
|
||||
// test the bit
|
||||
#define CCMAP_HAS_CHAR(m,c) (((CCMAP_TO_ALU(m,c))>>CCMAP_BIT_INDEX(c)) & 1)
|
||||
|
||||
// unset the bit
|
||||
#define CCMAP_UNSET_CHAR(m,c) (CCMAP_TO_ALU(m,c) &= ~(CCMAP_POW2(CCMAP_BIT_INDEX(c))))
|
||||
|
||||
#define CCMAP_SIZE(m) (*((m)-1))
|
||||
#define CCMAP_FLAG(m) (*((m)-2))
|
||||
#define CCMAP_EXTRA (sizeof(ALU_TYPE)/sizeof(PRUint16)>2? sizeof(ALU_TYPE)/sizeof(PRUint16): 2)
|
||||
#define CCMAP_SURROGATE_FLAG 0x0001
|
||||
#define CCMAP_NONE_FLAG 0x0000
|
||||
|
||||
// get plane number from ccmap, bmp excluded, so plane 1's number is 0.
|
||||
#define CCMAP_PLANE_FROM_SURROGATE(h) ((((PRUint16)(h) - (PRUint16)0xd800) >> 6) + 1)
|
||||
|
||||
// same as above, but get plane number from a ucs4 char
|
||||
#define CCMAP_PLANE(u) ((((PRUint32)(u))>>16))
|
||||
|
||||
// scalar value inside the plane
|
||||
#define CCMAP_INPLANE_OFFSET(h, l) (((((PRUint16)(h) - (PRUint16)0xd800) & 0x3f) << 10) + ((PRUint16)(l) - (PRUint16)0xdc00))
|
||||
|
||||
// get ccmap for that plane
|
||||
#define CCMAP_FOR_PLANE_EXT(m, i) ((m) + ((PRUint32*)((m) + CCMAP_SIZE(m)))[(i)-1])
|
||||
|
||||
// test the bit for surrogate pair
|
||||
#define CCMAP_HAS_CHAR_EXT2(m, h, l) (CCMAP_FLAG(m) & CCMAP_SURROGATE_FLAG && \
|
||||
CCMAP_HAS_CHAR(CCMAP_FOR_PLANE_EXT((m), CCMAP_PLANE_FROM_SURROGATE(h)), CCMAP_INPLANE_OFFSET(h, l)))
|
||||
// test the bit for a character in UCS4
|
||||
#define CCMAP_HAS_CHAR_EXT(m, ucs4) (((ucs4)&0xffff0000) ? \
|
||||
(CCMAP_FLAG(m) & CCMAP_SURROGATE_FLAG) && CCMAP_HAS_CHAR(CCMAP_FOR_PLANE_EXT((m), CCMAP_PLANE(ucs4)), (ucs4) & 0xffff) : \
|
||||
CCMAP_HAS_CHAR(m, (PRUnichar)(ucs4)) )
|
||||
#endif // NSCOMPRESSEDCHARMAP_H
|
|
@ -0,0 +1,204 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* Contributor(s): Jungshik Shin <jshin@mailaps.org> (Original developer)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*========================================================
|
||||
This file contains a precompiled CCMap for a class of Unicode
|
||||
characters (blank_glyph) to be identified quickly by Mozilla.
|
||||
It was generated by ccmapbin.pl which you can find under
|
||||
mozilla/intl/unicharutil/tools.
|
||||
|
||||
Enumerated below are characters included in the precompiled CCMap
|
||||
which is human-readable but not so human-friendly. If you
|
||||
needs to modify the list of characters belonging to "blank_glyph",
|
||||
you have to make a new file (with the name of your choice)
|
||||
listing characters (one character per line) you want to put
|
||||
into "blank_glyph" in the format
|
||||
|
||||
0xuuuu // comment
|
||||
|
||||
In addition, the input file can have the following optional lines that
|
||||
read
|
||||
|
||||
CLASS::blank_glyph
|
||||
DESCRIPTION:: description of a character class
|
||||
FILE:: mozilla source file to include output files
|
||||
|
||||
|
||||
Then, run the following in the current directory.
|
||||
|
||||
perl ccmapbin.pl input_file [blank_glyph]
|
||||
|
||||
which will generate blank_glyph.ccmap.
|
||||
|
||||
(see bug 180266 and bug 167136)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
CLASS:: blank_glyph
|
||||
|
||||
0X3000 : IDEOGRAPHIC SPACE
|
||||
0X3164 : HANGUL COMPATIBILITY JAMO FILLER
|
||||
0X00A0 : NO-BREAK SPACE
|
||||
0X0020 : SPACE
|
||||
0X115F : HANGUL LEADING CONSONANT FILLER
|
||||
0X1160 : HANGUL VOWEL FILLER
|
||||
0XFEFF : BYTE ORDER MARK^L
|
||||
0XFFA0 : HALFWIDTH HANGUL FILLER
|
||||
0XFFF9 : INTERLINEAR ANNOTATION ANCHOR
|
||||
0XFFFA : INTERLINEAR ANNOTATION SEPERATOR
|
||||
0XFFFB : INTERLINEAR ANNOTATION TERMINATOR
|
||||
0X2000 : EN QUAD
|
||||
0X2001 : EM QUAD
|
||||
0X2002 : EN SPACE
|
||||
0X2003 : EM SPACE
|
||||
0X2004 : THREE-PER-EM SPACE
|
||||
0X2005 : FOUR-PER-EM SPACE
|
||||
0X2006 : SIX-PER-EM SPACE
|
||||
0X2007 : FIGURE SPACE
|
||||
0X2008 : PUNCTUATION SPACE
|
||||
0X2009 : THIN SPACE
|
||||
0X200A : HAIR SPACE
|
||||
0X200B : ZERO WIDTH SPACE
|
||||
0X200C : ZERO WIDTH NON-JOINER
|
||||
0X200D : ZERO WIDTH JOINER
|
||||
0X200E : LEFT-TO-RIGHT MARK
|
||||
0X200F : RIGHT-TO-LEFT MARK
|
||||
0X202A : LEFT-TO-RIGHT EMBEDDING
|
||||
0X202B : RIGHT-TO-LEFT EMBEDDING
|
||||
0X202C : POP DIRECTIONAL FORMATTING
|
||||
0X202D : LEFT-TO-RIGHT OVERRIDE
|
||||
0X202E : RIGHT-TO-LEFT OVERRIDE
|
||||
0X202F : NARROW NO-BREAK SPACE
|
||||
*/
|
||||
|
||||
#if (defined(IS_LITTLE_ENDIAN) || ALU_SIZE == 16)
|
||||
// Precompiled CCMap for Big Endian(16bit)/Little Endian(16/32/64bit)
|
||||
/* 0000 */ 0x0030,0x0050,0x0070,0x0090,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x00C0,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0040,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x0000,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0020,0x0060,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0060 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x8000,0x0001,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0070 */ 0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0080 */ 0xFFFF,0x0000,0xFC00,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0090 */ 0x00A0,0x00B0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00a0 */ 0x0001,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00b0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0010,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00c0 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x00D0,0x00E0,
|
||||
/* 00d0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x8000,
|
||||
/* 00e0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0001,0x0000,0x0000,0x0000,0x0000,0x0E00,
|
||||
#elif (ALU_SIZE == 32)
|
||||
// Precompiled CCMap for Big Endian(32bit)
|
||||
/* 0000 */ 0x0030,0x0050,0x0070,0x0090,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x00C0,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0040,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x0000,0x0000,0x0001,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0001,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0020,0x0060,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0060 */ 0x0000,0x0000,0x0000,0x0000,0x8000,0x0000,0x0000,0x0001,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0070 */ 0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0080 */ 0x0000,0xFFFF,0x0000,0xFC00,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0090 */ 0x00A0,0x00B0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00a0 */ 0x0000,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00b0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0010,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00c0 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x00D0,0x00E0,
|
||||
/* 00d0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x8000,0x0000,
|
||||
/* 00e0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0001,0x0000,0x0000,0x0E00,0x0000,
|
||||
#elif (ALU_SIZE == 64)
|
||||
// Precompiled CCMap for Big Endian(64bit)
|
||||
/* 0000 */ 0x0030,0x0050,0x0070,0x0090,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x00C0,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0040,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0020,0x0060,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0060 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0001,0x8000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0070 */ 0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0080 */ 0x0000,0xFC00,0x0000,0xFFFF,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0090 */ 0x00A0,0x00B0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00a0 */ 0x0000,0x0000,0x0000,0x0001,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00b0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0010,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00c0 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x00D0,0x00E0,
|
||||
/* 00d0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x8000,0x0000,0x0000,0x0000,
|
||||
/* 00e0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0001,0x0000,0x0000,0x0E00,0x0000,0x0000,0x0000,
|
||||
#else
|
||||
#error "We don't support this architecture."
|
||||
#endif
|
||||
|
|
@ -1347,7 +1347,17 @@ PLHashAllocOps fontmap_HashAllocOps = {
|
|||
fontmap_AllocEntry, fontmap_FreeEntry
|
||||
};
|
||||
|
||||
#define SHOULD_BE_SPACE_CHAR(ch) ((ch)==0x0020 || (ch)==0x00A0 || ((ch)>=0x2000 && ((ch)<=0x200B || (ch)==0x3000)))
|
||||
// See bug 167136. Characters included in the list (see one of included
|
||||
// files for the list) is the union of the set included in
|
||||
// SHOULD_BE_SPACE macro replaced by this list and the set compiled by
|
||||
// Keith Packard to use in fonts.conf of fontconfig package.
|
||||
// Some of this may not have to be here because they're filtered out before
|
||||
// reaching here. Needs further investigation.
|
||||
static const PRUint16 gCharsWithBlankGlyphCCMap[] = {
|
||||
#include "blank_glyph.ccmap"
|
||||
};
|
||||
|
||||
#define SHOULD_BE_SPACE_CHAR(ch) (CCMAP_HAS_CHAR(gCharsWithBlankGlyphCCMap,ch))
|
||||
|
||||
enum {
|
||||
eTTPlatformIDUnicode = 0,
|
||||
|
|
|
@ -0,0 +1,161 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* Contributor(s): Jungshik Shin <jshin@mailaps.org> (Original developer)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*========================================================
|
||||
This file contains a precompiled CCMap for a class of Unicode
|
||||
characters (dbyte_special_chars) to be identified quickly by Mozilla.
|
||||
It was generated by ccmapbin.pl which you can find under
|
||||
mozilla/intl/unicharutil/tools.
|
||||
|
||||
Enumerated below are characters included in the precompiled CCMap
|
||||
which is human-readable but not so human-friendly. If you
|
||||
needs to modify the list of characters belonging to "dbyte_special_chars",
|
||||
you have to make a new file (with the name of your choice)
|
||||
listing characters (one character per line) you want to put
|
||||
into "dbyte_special_chars" in the format
|
||||
|
||||
0xuuuu // comment
|
||||
|
||||
In addition, the input file can have the following optional lines that
|
||||
read
|
||||
|
||||
CLASS::dbyte_special_chars
|
||||
DESCRIPTION:: description of a character class
|
||||
FILE:: mozilla source file to include output files
|
||||
|
||||
|
||||
Then, run the following in the current directory.
|
||||
|
||||
perl ccmapbin.pl input_file [dbyte_special_chars]
|
||||
|
||||
which will generate dbyte_special_chars.ccmap.
|
||||
|
||||
(see bug 180266 and bug 167136)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
0X0152 : LATIN CAPITAL LIGATURE OE
|
||||
0X0153 : LATIN SMALL LIGATURE OE
|
||||
0X0160 : LATIN CAPITAL LETTER S WITH CARON
|
||||
0X0161 : LATIN SMALL LETTER S WITH CARON
|
||||
0X0178 : LATIN CAPITAL LETTER Y WITH DIAERESIS
|
||||
0X017D : LATIN CAPITAL LETTER Z WITH CARON
|
||||
0X017E : LATIN SMALL LETTER Z WITH CARON
|
||||
0X0192 : LATIN SMALL LETTER F WITH HOOK
|
||||
0X02C6 : MODIFIER LETTER CIRCUMFLEX ACCENT
|
||||
0X02DC : SMALL TILDE
|
||||
0X2013 : EN DASH
|
||||
0X2014 : EM DASH
|
||||
0X2018 : LEFT SINGLE QUOTATION MARK
|
||||
0X2019 : RIGHT SINGLE QUOTATION MARK
|
||||
0X201A : SINGLE LOW-9 QUOTATION MARK
|
||||
0X201C : LEFT DOUBLE QUOTATION MARK
|
||||
0X201D : RIGHT DOUBLE QUOTATION MARK
|
||||
0X201E : DOUBLE LOW-9 QUOTATION MARK
|
||||
0X2020 : DAGGER
|
||||
0X2021 : DOUBLE DAGGER
|
||||
0X2022 : BULLET
|
||||
0X2026 : HORIZONTAL ELLIPSIS
|
||||
0X2030 : PER MILLE SIGN
|
||||
0X2039 : SINGLE LEFT-POINTING ANGLE QUOTATION MARK
|
||||
0X203A : SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
|
||||
0X20AC : EURO SIGN
|
||||
0X2122 : TRADE MARK SIGN
|
||||
*/
|
||||
|
||||
#if (defined(IS_LITTLE_ENDIAN) || ALU_SIZE == 16)
|
||||
// Precompiled CCMap for Big Endian(16bit)/Little Endian(16/32/64bit)
|
||||
/* 0000 */ 0x0030,0x0010,0x0060,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0020,0x0040,0x0050,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x000C,0x0003,0x6100,
|
||||
0x0000,0x0004,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0040,0x1000,0x0000,0x0000,
|
||||
/* 0060 */ 0x0070,0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0070 */ 0x0000,0x7718,0x0047,0x0601,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x1000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0080 */ 0x0000,0x0000,0x0004,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
#elif (ALU_SIZE == 32)
|
||||
// Precompiled CCMap for Big Endian(32bit)
|
||||
/* 0000 */ 0x0030,0x0010,0x0060,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0020,0x0040,0x0050,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x0000,0x0000,0x0000,0x000C,0x0000,0x6100,0x0003,
|
||||
0x0004,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x1000,0x0040,0x0000,0x0000,
|
||||
/* 0060 */ 0x0070,0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0070 */ 0x7718,0x0000,0x0601,0x0047,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x1000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0080 */ 0x0000,0x0000,0x0000,0x0004,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
#elif (ALU_SIZE == 64)
|
||||
// Precompiled CCMap for Big Endian(64bit)
|
||||
/* 0000 */ 0x0030,0x0010,0x0060,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0020,0x0040,0x0050,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x0000,0x0000,0x0000,0x6100,0x0003,0x000C,0x0000,
|
||||
0x0000,0x0000,0x0004,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x1000,0x0040,
|
||||
/* 0060 */ 0x0070,0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0070 */ 0x0601,0x0047,0x7718,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x1000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0080 */ 0x0000,0x0004,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
#else
|
||||
#error "We don't support this architecture."
|
||||
#endif
|
||||
|
|
@ -861,40 +861,12 @@ atomToName(nsIAtom* aAtom)
|
|||
//
|
||||
// smart quotes (and other special chars) in Asian (double byte)
|
||||
// fonts are too large to use is western fonts.
|
||||
// Here we define those characters.
|
||||
// To update the list, see one of files included below. (bug 180266)
|
||||
//
|
||||
static const PRUnichar gDoubleByteSpecialChars[] = {
|
||||
0x0152, /* LATIN CAPITAL LIGATURE OE */
|
||||
0x0153, /* LATIN SMALL LIGATURE OE */
|
||||
0x0160, /* LATIN CAPITAL LETTER S WITH CARON */
|
||||
0x0161, /* LATIN SMALL LETTER S WITH CARON */
|
||||
0x0178, /* LATIN CAPITAL LETTER Y WITH DIAERESIS */
|
||||
0x017D, /* LATIN CAPITAL LETTER Z WITH CARON */
|
||||
0x017E, /* LATIN SMALL LETTER Z WITH CARON */
|
||||
0x0192, /* LATIN SMALL LETTER F WITH HOOK */
|
||||
0x02C6, /* MODIFIER LETTER CIRCUMFLEX ACCENT */
|
||||
0x02DC, /* SMALL TILDE */
|
||||
0x2013, /* EN DASH */
|
||||
0x2014, /* EM DASH */
|
||||
0x2018, /* LEFT SINGLE QUOTATION MARK */
|
||||
0x2019, /* RIGHT SINGLE QUOTATION MARK */
|
||||
0x201A, /* SINGLE LOW-9 QUOTATION MARK */
|
||||
0x201C, /* LEFT DOUBLE QUOTATION MARK */
|
||||
0x201D, /* RIGHT DOUBLE QUOTATION MARK */
|
||||
0x201E, /* DOUBLE LOW-9 QUOTATION MARK */
|
||||
0x2020, /* DAGGER */
|
||||
0x2021, /* DOUBLE DAGGER */
|
||||
0x2022, /* BULLET */
|
||||
0x2026, /* HORIZONTAL ELLIPSIS */
|
||||
0x2030, /* PER MILLE SIGN */
|
||||
0x2039, /* SINGLE LEFT-POINTING ANGLE QUOTATION MARK */
|
||||
0x203A, /* SINGLE RIGHT-POINTING ANGLE QUOTATION MARK */
|
||||
0x20AC, /* EURO SIGN */
|
||||
0x2122, /* TRADE MARK SIGN */
|
||||
0
|
||||
static const PRUint16 gDoubleByteSpecialCharsCCMap[] = {
|
||||
#include "dbyte_special_chars.ccmap"
|
||||
};
|
||||
|
||||
|
||||
|
||||
static PRBool
|
||||
FreeCharSetMap(nsHashKey* aKey, void* aData, void* aClosure)
|
||||
{
|
||||
|
@ -1034,7 +1006,7 @@ nsFontMetricsXlibContext::~nsFontMetricsXlibContext()
|
|||
}
|
||||
FreeCCMap(mUserDefinedCCMap);
|
||||
FreeCCMap(mEmptyCCMap);
|
||||
FreeCCMap(mDoubleByteSpecialCharsCCMap);
|
||||
PR_Free(mDoubleByteSpecialCharsCCMap);
|
||||
|
||||
/* Free memory allocated by |CopyFontCharSetMapXlib()| */
|
||||
if (mCharSetMap) {
|
||||
|
@ -1187,14 +1159,11 @@ nsFontMetricsXlibContext::Init(nsIDeviceContext *aDevice, PRBool aPrintermode)
|
|||
if (NS_SUCCEEDED(rv))
|
||||
mAllowDoubleByteSpecialChars = val;
|
||||
|
||||
// setup the double byte font special chars glyph map
|
||||
nsCompressedCharMap specialchars_ccmapObj;
|
||||
for (int i=0; gDoubleByteSpecialChars[i]; i++) {
|
||||
specialchars_ccmapObj.SetChar(gDoubleByteSpecialChars[i]);
|
||||
}
|
||||
mDoubleByteSpecialCharsCCMap = specialchars_ccmapObj.NewCCMap();
|
||||
PRUint32 dbmapSize = sizeof(gDoubleByteSpecialCharsCCMap);
|
||||
mDoubleByteSpecialCharsCCMap = (PRUint16*)PR_Malloc(dbmapSize);
|
||||
if (!mDoubleByteSpecialCharsCCMap)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
memcpy(mDoubleByteSpecialCharsCCMap, gDoubleByteSpecialCharsCCMap, dbmapSize);
|
||||
|
||||
PRInt32 scale_minimum = 0;
|
||||
rv = mPref->GetIntPref("font.scale.outline.min", &scale_minimum);
|
||||
|
@ -2602,8 +2571,15 @@ SetUpFontCharSetInfo(nsFontMetricsXlibContext *aFmctx, nsFontCharSetInfoXlib* aS
|
|||
if ((aSelf->Convert == DoubleByteConvert)
|
||||
&& (!aFmctx->mAllowDoubleByteSpecialChars)) {
|
||||
PRUint16* ccmap = aSelf->mCCMap;
|
||||
for (int i=0; gDoubleByteSpecialChars[i]; i++) {
|
||||
CCMAP_UNSET_CHAR(ccmap, gDoubleByteSpecialChars[i]);
|
||||
PRUint32 page = CCMAP_BEGIN_AT_START_OF_MAP;
|
||||
const PRUint16* specialmap = aFmctx->mDoubleByteSpecialCharsCCMap;
|
||||
while (NextNonEmptyCCMapPage(specialmap, &page)) {
|
||||
PRUint32 pagechar = page;
|
||||
for (int i=0; i < CCMAP_BITS_PER_PAGE; i++) {
|
||||
if (CCMAP_HAS_CHAR(specialmap, pagechar))
|
||||
CCMAP_UNSET_CHAR(ccmap, pagechar);
|
||||
pagechar++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return PR_TRUE;
|
||||
|
|
|
@ -111,13 +111,13 @@ MapperToCCMap(nsICharRepresentable *aMapper)
|
|||
}
|
||||
|
||||
PRBool
|
||||
NextNonEmptyCCMapPage(PRUint16* aCCMap, PRUint32 *aPageStart)
|
||||
NextNonEmptyCCMapPage(const PRUint16* aCCMap, PRUint32 *aPageStart)
|
||||
{
|
||||
int i, j, l;
|
||||
int planeend = 0;
|
||||
int planestart = 0;
|
||||
unsigned int k;
|
||||
PRUint16* ccmap;
|
||||
const PRUint16* ccmap;
|
||||
PRUint32 pagestart = *aPageStart;
|
||||
|
||||
if(CCMAP_FLAG(aCCMap) & CCMAP_SURROGATE_FLAG) {
|
||||
|
@ -154,20 +154,20 @@ NextNonEmptyCCMapPage(PRUint16* aCCMap, PRUint32 *aPageStart)
|
|||
}
|
||||
|
||||
// walk thru the upper pointers
|
||||
PRUint16 *upper = &ccmap[0];
|
||||
const PRUint16 *upper = &ccmap[0];
|
||||
for (i=upper_index; i<CCMAP_NUM_UPPER_POINTERS; i++, mid_index=0) {
|
||||
if (upper[i] == CCMAP_EMPTY_MID) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// walk the mid array
|
||||
PRUint16 *mid = &ccmap[upper[i]];
|
||||
const PRUint16 *mid = &ccmap[upper[i]];
|
||||
for (j=mid_index; j<CCMAP_NUM_MID_POINTERS; j++) {
|
||||
if (mid[j] == CCMAP_EMPTY_PAGE)
|
||||
continue;
|
||||
|
||||
// walk the page
|
||||
ALU_TYPE *page = (ALU_TYPE*)&ccmap[mid[j]];
|
||||
const ALU_TYPE *page = (ALU_TYPE*)&ccmap[mid[j]];
|
||||
for (k=0; k<CCMAP_NUM_ALUS_PER_PAGE; k++) {
|
||||
if (page[k] != 0) {
|
||||
PRUint32 base = (i*CCMAP_NUM_UCHARS_PER_MID) + (j*CCMAP_NUM_UCHARS_PER_PAGE);
|
||||
|
|
|
@ -67,7 +67,7 @@ extern PRUint16* CreateEmptyCCMap();
|
|||
extern PRUint16* MapToCCMap(PRUint32* aMap);
|
||||
extern PRUint16* MapperToCCMap(nsICharRepresentable *aMapper);
|
||||
extern void FreeCCMap(PRUint16* &aMap);
|
||||
extern PRBool NextNonEmptyCCMapPage(PRUint16 *, PRUint32 *);
|
||||
extern PRBool NextNonEmptyCCMapPage(const PRUint16 *, PRUint32 *);
|
||||
extern PRBool IsSameCCMap(PRUint16* ccmap1, PRUint16* ccmap2);
|
||||
#ifdef DEBUG
|
||||
void printCCMap(PRUint16* aCCMap);
|
||||
|
|
|
@ -83,6 +83,8 @@
|
|||
|
||||
#include "nsILineIterator.h"
|
||||
|
||||
#include "nsCompressedCharMap.h"
|
||||
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
@ -4637,65 +4639,16 @@ nsTextFrame::EstimateNumChars(PRUint32 aAvailableWidth,
|
|||
PRUint32 estimatedNumChars = aAvailableWidth / aAverageCharWidth;
|
||||
return estimatedNumChars + estimatedNumChars / 20;
|
||||
}
|
||||
|
||||
static PRBool
|
||||
IsPunctuationMark(PRUnichar aChar)
|
||||
{
|
||||
//The following table is generated by a method written by Ftang, see bug 54467.
|
||||
//In case we need to add or substract any character (for example, unicode standard got
|
||||
// updated), the character in table must be kept in strict ascending order
|
||||
static const PRUnichar PuncSet[] =
|
||||
{
|
||||
0x0021, 0x0022, 0x0023, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029,
|
||||
0x002A, 0x002C, 0x002E, 0x002F, 0x003A, 0x003B, 0x003F, 0x0040,
|
||||
0x005B, 0x005C, 0x005D, 0x007B, 0x007D, 0x00A1, 0x00B7, 0x00BF,
|
||||
0x0313, 0x037E, 0x0387, 0x055A, 0x055B, 0x055C, 0x055D, 0x055E,
|
||||
0x055F, 0x0589, 0x05BE, 0x05C0, 0x05C3, 0x05F3, 0x05F4, 0x060C,
|
||||
0x061B, 0x061F, 0x066A, 0x066B, 0x066C, 0x066D, 0x06D4, 0x0700,
|
||||
0x0701, 0x0702, 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x0708,
|
||||
0x0709, 0x070A, 0x070B, 0x070C, 0x070D, 0x0964, 0x0965, 0x0970,
|
||||
0x0DF4, 0x0E4F, 0x0E5A, 0x0E5B, 0x0F04, 0x0F05, 0x0F06, 0x0F07,
|
||||
0x0F08, 0x0F09, 0x0F0A, 0x0F0B, 0x0F0C, 0x0F0D, 0x0F0E, 0x0F0F,
|
||||
0x0F10, 0x0F11, 0x0F12, 0x0F3A, 0x0F3B, 0x0F3C, 0x0F3D, 0x0F85,
|
||||
0x104A, 0x104B, 0x104C, 0x104D, 0x104E, 0x104F, 0x10FB, 0x1361,
|
||||
0x1362, 0x1363, 0x1364, 0x1365, 0x1366, 0x1367, 0x1368, 0x166D,
|
||||
0x166E, 0x169B, 0x169C, 0x16EB, 0x16EC, 0x16ED, 0x17D4, 0x17D5,
|
||||
0x17D6, 0x17D7, 0x17D8, 0x17D9, 0x17DA, 0x17DC, 0x1800, 0x1801,
|
||||
0x1802, 0x1803, 0x1804, 0x1805, 0x1807, 0x1808, 0x1809, 0x180A,
|
||||
0x2016, 0x2017, 0x201A, 0x201E, 0x2020, 0x2021, 0x2022, 0x2023,
|
||||
0x2024, 0x2025, 0x2026, 0x2027, 0x2030, 0x2031, 0x2032, 0x2033,
|
||||
0x2034, 0x2035, 0x2036, 0x2037, 0x2038, 0x203B, 0x203C, 0x203D,
|
||||
0x203E, 0x2041, 0x2042, 0x2043, 0x2045, 0x2046, 0x2048, 0x2049,
|
||||
0x204A, 0x204B, 0x204C, 0x204D, 0x207D, 0x207E, 0x208D, 0x208E,
|
||||
0x2329, 0x232A, 0x3001, 0x3002, 0x3003, 0x3008, 0x3009, 0x300A,
|
||||
0x300B, 0x300C, 0x300D, 0x300E, 0x300F, 0x3010, 0x3011, 0x3014,
|
||||
0x3015, 0x3016, 0x3017, 0x3018, 0x3019, 0x301A, 0x301B, 0x301D,
|
||||
0x301E, 0x301F, 0xFD3E, 0xFD3F, 0xFE30, 0xFE35, 0xFE36, 0xFE37,
|
||||
0xFE38, 0xFE39, 0xFE3A, 0xFE3B, 0xFE3C, 0xFE3D, 0xFE3E, 0xFE3F,
|
||||
0xFE40, 0xFE41, 0xFE42, 0xFE43, 0xFE44, 0xFE49, 0xFE4A, 0xFE4B,
|
||||
0xFE4C, 0xFE50, 0xFE51, 0xFE52, 0xFE54, 0xFE55, 0xFE56, 0xFE57,
|
||||
0xFE59, 0xFE5A, 0xFE5B, 0xFE5C, 0xFE5D, 0xFE5E, 0xFE5F, 0xFE60,
|
||||
0xFE61, 0xFE68, 0xFE6A, 0xFE6B, 0xFF01, 0xFF02, 0xFF03, 0xFF05,
|
||||
0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFF0C, 0xFF0E, 0xFF0F,
|
||||
0xFF1A, 0xFF1B, 0xFF1F, 0xFF20, 0xFF3B, 0xFF3C, 0xFF3D, 0xFF5B,
|
||||
0xFF5D, 0xFF61, 0xFF62, 0xFF63, 0xFF64,
|
||||
};
|
||||
static PRInt32 PuncSetSize = sizeof(PuncSet) / sizeof(PuncSet[0]);
|
||||
|
||||
PRInt32 i = PuncSetSize/2, begin = 0, end = PuncSetSize -1;
|
||||
|
||||
for (; begin != end; i = (begin + end ) / 2)
|
||||
{
|
||||
if (aChar == PuncSet[i])
|
||||
return PR_TRUE;
|
||||
if (aChar > PuncSet[i])
|
||||
begin = i+1;
|
||||
else
|
||||
end = i;
|
||||
}
|
||||
|
||||
return (aChar == PuncSet[i]);
|
||||
}
|
||||
// Replaced by precompiled CCMap (see bug 180266). To update the list
|
||||
// of characters, see one of files included below. As for the way
|
||||
// the original list of characters was obtained by Frank Tang, see bug 54467.
|
||||
static const PRUint16 gPuncCharsCCMap[] =
|
||||
{
|
||||
#include "punct_marks.ccmap"
|
||||
};
|
||||
|
||||
#define IsPunctuationMark(ch) (CCMAP_HAS_CHAR(gPuncCharsCCMap, ch))
|
||||
|
||||
nsReflowStatus
|
||||
nsTextFrame::MeasureText(nsIPresContext* aPresContext,
|
||||
|
|
|
@ -0,0 +1,247 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* Contributor(s): Jungshik Shin <jshin@mailaps.org> (Original developer)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*========================================================
|
||||
This file contains a precompiled CCMap for a class of Unicode
|
||||
characters (punct_marks) to be identified quickly by Mozilla.
|
||||
It was generated by ccmapbin.pl which you can find under
|
||||
mozilla/intl/unicharutil/tools.
|
||||
|
||||
Enumerated below are characters included in the precompiled CCMap
|
||||
which is human-readable but not so human-friendly. If you
|
||||
needs to modify the list of characters belonging to "punct_marks",
|
||||
you have to make a new file (with the name of your choice)
|
||||
listing characters (one character per line) you want to put
|
||||
into "punct_marks" in the format
|
||||
|
||||
0xuuuu // comment
|
||||
|
||||
In addition, the input file can have the following optional lines that
|
||||
read
|
||||
|
||||
CLASS::punct_marks
|
||||
DESCRIPTION:: description of a character class
|
||||
FILE:: mozilla source file to include output files
|
||||
|
||||
|
||||
Then, run the following in the current directory.
|
||||
|
||||
perl ccmapbin.pl input_file [punct_marks]
|
||||
|
||||
which will generate punct_marks.ccmap.
|
||||
|
||||
(see bug 180266 and bug 167136)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
0X3001 :
|
||||
0X3002 :
|
||||
0X3003 :
|
||||
0X3008 :
|
||||
0X3009 :
|
||||
0X3010 :
|
||||
0X3011 :
|
||||
0X3014 :
|
||||
0X3016 :
|
||||
0X3017 :
|
||||
0X3018 :
|
||||
0X3019 :
|
||||
0X0589 :
|
||||
0X0700 :
|
||||
0X0702 :
|
||||
0X0703 :
|
||||
0X0704 :
|
||||
0X0705 :
|
||||
0X0706 :
|
||||
0X0707 :
|
||||
0X0708 :
|
||||
0X0964 :
|
||||
0X0965 :
|
||||
0X0970 :
|
||||
0X0022 :
|
||||
0X0023 :
|
||||
0X0025 :
|
||||
0X0026 :
|
||||
0X0027 :
|
||||
0X0028 :
|
||||
0X0029 :
|
||||
0X1361 :
|
||||
0X1363 :
|
||||
0X1364 :
|
||||
0X1365 :
|
||||
0X1366 :
|
||||
0X1367 :
|
||||
0X1368 :
|
||||
0X1800 :
|
||||
0X1801 :
|
||||
0X1803 :
|
||||
0X1804 :
|
||||
0X1805 :
|
||||
0X1807 :
|
||||
0X1808 :
|
||||
0X1809 :
|
||||
0X0040 :
|
||||
0X2017 :
|
||||
0X2020 :
|
||||
0X2021 :
|
||||
0X2022 :
|
||||
0X2023 :
|
||||
0X2025 :
|
||||
0X2026 :
|
||||
0X2027 :
|
||||
0X2030 :
|
||||
0X2031 :
|
||||
0X2032 :
|
||||
0X2033 :
|
||||
0X2035 :
|
||||
0X2036 :
|
||||
0X2037 :
|
||||
0X2038 :
|
||||
0X2041 :
|
||||
0X2042 :
|
||||
0X2043 :
|
||||
0X2045 :
|
||||
0X2046 :
|
||||
0X2048 :
|
||||
0X2049 :
|
||||
0X0387 :
|
||||
*/
|
||||
|
||||
#if (defined(IS_LITTLE_ENDIAN) || ALU_SIZE == 16)
|
||||
// Precompiled CCMap for Big Endian(16bit)/Little Endian(16/32/64bit)
|
||||
/* 0000 */ 0x0030,0x0090,0x00C0,0x00E0,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0040,0x0020,0x0020,0x0050,0x0020,0x0060,0x0020,0x0070,
|
||||
0x0020,0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x0000,0x03EC,0x0000,0x0001,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0080,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0060 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0200,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0070 */ 0x01FD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0080 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0030,0x0001,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0090 */ 0x0020,0x0020,0x0020,0x00A0,0x0020,0x0020,0x0020,0x0020,
|
||||
0x00B0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00a0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x01FA,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00b0 */ 0x03BB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00c0 */ 0x00D0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00d0 */ 0x0000,0x0080,0x00EF,0x01EF,0x036E,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00e0 */ 0x00F0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00f0 */ 0x030E,0x03D3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
#elif (ALU_SIZE == 32)
|
||||
// Precompiled CCMap for Big Endian(32bit)
|
||||
/* 0000 */ 0x0030,0x0090,0x00C0,0x00E0,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0040,0x0020,0x0020,0x0050,0x0020,0x0060,0x0020,0x0070,
|
||||
0x0020,0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x0000,0x0000,0x03EC,0x0000,0x0001,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0080,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0060 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0200,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0070 */ 0x0000,0x01FD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0080 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0001,0x0030,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0090 */ 0x0020,0x0020,0x0020,0x00A0,0x0020,0x0020,0x0020,0x0020,
|
||||
0x00B0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00a0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x01FA,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00b0 */ 0x0000,0x03BB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00c0 */ 0x00D0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00d0 */ 0x0080,0x0000,0x01EF,0x00EF,0x0000,0x036E,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00e0 */ 0x00F0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00f0 */ 0x03D3,0x030E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
#elif (ALU_SIZE == 64)
|
||||
// Precompiled CCMap for Big Endian(64bit)
|
||||
/* 0000 */ 0x0030,0x0090,0x00C0,0x00E0,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0040,0x0020,0x0020,0x0050,0x0020,0x0060,0x0020,0x0070,
|
||||
0x0020,0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x03EC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0001,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0080,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0060 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0200,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0070 */ 0x0000,0x0000,0x0000,0x01FD,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0080 */ 0x0000,0x0000,0x0000,0x0000,0x0001,0x0030,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0090 */ 0x0020,0x0020,0x0020,0x00A0,0x0020,0x0020,0x0020,0x0020,
|
||||
0x00B0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00a0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x01FA,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00b0 */ 0x0000,0x0000,0x0000,0x03BB,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00c0 */ 0x00D0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00d0 */ 0x01EF,0x00EF,0x0080,0x0000,0x0000,0x0000,0x0000,0x036E,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00e0 */ 0x00F0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00f0 */ 0x0000,0x0000,0x03D3,0x030E,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
#else
|
||||
#error "We don't support this architecture."
|
||||
#endif
|
||||
|
|
@ -57,6 +57,7 @@ REQUIRES = xpcom \
|
|||
java \
|
||||
exthandler \
|
||||
intl \
|
||||
uconv \
|
||||
$(NULL)
|
||||
|
||||
# Sun's Complex Text Layout support
|
||||
|
|
|
@ -83,6 +83,8 @@
|
|||
|
||||
#include "nsILineIterator.h"
|
||||
|
||||
#include "nsCompressedCharMap.h"
|
||||
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
@ -4637,65 +4639,16 @@ nsTextFrame::EstimateNumChars(PRUint32 aAvailableWidth,
|
|||
PRUint32 estimatedNumChars = aAvailableWidth / aAverageCharWidth;
|
||||
return estimatedNumChars + estimatedNumChars / 20;
|
||||
}
|
||||
|
||||
static PRBool
|
||||
IsPunctuationMark(PRUnichar aChar)
|
||||
{
|
||||
//The following table is generated by a method written by Ftang, see bug 54467.
|
||||
//In case we need to add or substract any character (for example, unicode standard got
|
||||
// updated), the character in table must be kept in strict ascending order
|
||||
static const PRUnichar PuncSet[] =
|
||||
{
|
||||
0x0021, 0x0022, 0x0023, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029,
|
||||
0x002A, 0x002C, 0x002E, 0x002F, 0x003A, 0x003B, 0x003F, 0x0040,
|
||||
0x005B, 0x005C, 0x005D, 0x007B, 0x007D, 0x00A1, 0x00B7, 0x00BF,
|
||||
0x0313, 0x037E, 0x0387, 0x055A, 0x055B, 0x055C, 0x055D, 0x055E,
|
||||
0x055F, 0x0589, 0x05BE, 0x05C0, 0x05C3, 0x05F3, 0x05F4, 0x060C,
|
||||
0x061B, 0x061F, 0x066A, 0x066B, 0x066C, 0x066D, 0x06D4, 0x0700,
|
||||
0x0701, 0x0702, 0x0703, 0x0704, 0x0705, 0x0706, 0x0707, 0x0708,
|
||||
0x0709, 0x070A, 0x070B, 0x070C, 0x070D, 0x0964, 0x0965, 0x0970,
|
||||
0x0DF4, 0x0E4F, 0x0E5A, 0x0E5B, 0x0F04, 0x0F05, 0x0F06, 0x0F07,
|
||||
0x0F08, 0x0F09, 0x0F0A, 0x0F0B, 0x0F0C, 0x0F0D, 0x0F0E, 0x0F0F,
|
||||
0x0F10, 0x0F11, 0x0F12, 0x0F3A, 0x0F3B, 0x0F3C, 0x0F3D, 0x0F85,
|
||||
0x104A, 0x104B, 0x104C, 0x104D, 0x104E, 0x104F, 0x10FB, 0x1361,
|
||||
0x1362, 0x1363, 0x1364, 0x1365, 0x1366, 0x1367, 0x1368, 0x166D,
|
||||
0x166E, 0x169B, 0x169C, 0x16EB, 0x16EC, 0x16ED, 0x17D4, 0x17D5,
|
||||
0x17D6, 0x17D7, 0x17D8, 0x17D9, 0x17DA, 0x17DC, 0x1800, 0x1801,
|
||||
0x1802, 0x1803, 0x1804, 0x1805, 0x1807, 0x1808, 0x1809, 0x180A,
|
||||
0x2016, 0x2017, 0x201A, 0x201E, 0x2020, 0x2021, 0x2022, 0x2023,
|
||||
0x2024, 0x2025, 0x2026, 0x2027, 0x2030, 0x2031, 0x2032, 0x2033,
|
||||
0x2034, 0x2035, 0x2036, 0x2037, 0x2038, 0x203B, 0x203C, 0x203D,
|
||||
0x203E, 0x2041, 0x2042, 0x2043, 0x2045, 0x2046, 0x2048, 0x2049,
|
||||
0x204A, 0x204B, 0x204C, 0x204D, 0x207D, 0x207E, 0x208D, 0x208E,
|
||||
0x2329, 0x232A, 0x3001, 0x3002, 0x3003, 0x3008, 0x3009, 0x300A,
|
||||
0x300B, 0x300C, 0x300D, 0x300E, 0x300F, 0x3010, 0x3011, 0x3014,
|
||||
0x3015, 0x3016, 0x3017, 0x3018, 0x3019, 0x301A, 0x301B, 0x301D,
|
||||
0x301E, 0x301F, 0xFD3E, 0xFD3F, 0xFE30, 0xFE35, 0xFE36, 0xFE37,
|
||||
0xFE38, 0xFE39, 0xFE3A, 0xFE3B, 0xFE3C, 0xFE3D, 0xFE3E, 0xFE3F,
|
||||
0xFE40, 0xFE41, 0xFE42, 0xFE43, 0xFE44, 0xFE49, 0xFE4A, 0xFE4B,
|
||||
0xFE4C, 0xFE50, 0xFE51, 0xFE52, 0xFE54, 0xFE55, 0xFE56, 0xFE57,
|
||||
0xFE59, 0xFE5A, 0xFE5B, 0xFE5C, 0xFE5D, 0xFE5E, 0xFE5F, 0xFE60,
|
||||
0xFE61, 0xFE68, 0xFE6A, 0xFE6B, 0xFF01, 0xFF02, 0xFF03, 0xFF05,
|
||||
0xFF06, 0xFF07, 0xFF08, 0xFF09, 0xFF0A, 0xFF0C, 0xFF0E, 0xFF0F,
|
||||
0xFF1A, 0xFF1B, 0xFF1F, 0xFF20, 0xFF3B, 0xFF3C, 0xFF3D, 0xFF5B,
|
||||
0xFF5D, 0xFF61, 0xFF62, 0xFF63, 0xFF64,
|
||||
};
|
||||
static PRInt32 PuncSetSize = sizeof(PuncSet) / sizeof(PuncSet[0]);
|
||||
|
||||
PRInt32 i = PuncSetSize/2, begin = 0, end = PuncSetSize -1;
|
||||
|
||||
for (; begin != end; i = (begin + end ) / 2)
|
||||
{
|
||||
if (aChar == PuncSet[i])
|
||||
return PR_TRUE;
|
||||
if (aChar > PuncSet[i])
|
||||
begin = i+1;
|
||||
else
|
||||
end = i;
|
||||
}
|
||||
|
||||
return (aChar == PuncSet[i]);
|
||||
}
|
||||
// Replaced by precompiled CCMap (see bug 180266). To update the list
|
||||
// of characters, see one of files included below. As for the way
|
||||
// the original list of characters was obtained by Frank Tang, see bug 54467.
|
||||
static const PRUint16 gPuncCharsCCMap[] =
|
||||
{
|
||||
#include "punct_marks.ccmap"
|
||||
};
|
||||
|
||||
#define IsPunctuationMark(ch) (CCMAP_HAS_CHAR(gPuncCharsCCMap, ch))
|
||||
|
||||
nsReflowStatus
|
||||
nsTextFrame::MeasureText(nsIPresContext* aPresContext,
|
||||
|
|
|
@ -0,0 +1,247 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla Communicator client code.
|
||||
*
|
||||
* Contributor(s): Jungshik Shin <jshin@mailaps.org> (Original developer)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*========================================================
|
||||
This file contains a precompiled CCMap for a class of Unicode
|
||||
characters (punct_marks) to be identified quickly by Mozilla.
|
||||
It was generated by ccmapbin.pl which you can find under
|
||||
mozilla/intl/unicharutil/tools.
|
||||
|
||||
Enumerated below are characters included in the precompiled CCMap
|
||||
which is human-readable but not so human-friendly. If you
|
||||
needs to modify the list of characters belonging to "punct_marks",
|
||||
you have to make a new file (with the name of your choice)
|
||||
listing characters (one character per line) you want to put
|
||||
into "punct_marks" in the format
|
||||
|
||||
0xuuuu // comment
|
||||
|
||||
In addition, the input file can have the following optional lines that
|
||||
read
|
||||
|
||||
CLASS::punct_marks
|
||||
DESCRIPTION:: description of a character class
|
||||
FILE:: mozilla source file to include output files
|
||||
|
||||
|
||||
Then, run the following in the current directory.
|
||||
|
||||
perl ccmapbin.pl input_file [punct_marks]
|
||||
|
||||
which will generate punct_marks.ccmap.
|
||||
|
||||
(see bug 180266 and bug 167136)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
0X3001 :
|
||||
0X3002 :
|
||||
0X3003 :
|
||||
0X3008 :
|
||||
0X3009 :
|
||||
0X3010 :
|
||||
0X3011 :
|
||||
0X3014 :
|
||||
0X3016 :
|
||||
0X3017 :
|
||||
0X3018 :
|
||||
0X3019 :
|
||||
0X0589 :
|
||||
0X0700 :
|
||||
0X0702 :
|
||||
0X0703 :
|
||||
0X0704 :
|
||||
0X0705 :
|
||||
0X0706 :
|
||||
0X0707 :
|
||||
0X0708 :
|
||||
0X0964 :
|
||||
0X0965 :
|
||||
0X0970 :
|
||||
0X0022 :
|
||||
0X0023 :
|
||||
0X0025 :
|
||||
0X0026 :
|
||||
0X0027 :
|
||||
0X0028 :
|
||||
0X0029 :
|
||||
0X1361 :
|
||||
0X1363 :
|
||||
0X1364 :
|
||||
0X1365 :
|
||||
0X1366 :
|
||||
0X1367 :
|
||||
0X1368 :
|
||||
0X1800 :
|
||||
0X1801 :
|
||||
0X1803 :
|
||||
0X1804 :
|
||||
0X1805 :
|
||||
0X1807 :
|
||||
0X1808 :
|
||||
0X1809 :
|
||||
0X0040 :
|
||||
0X2017 :
|
||||
0X2020 :
|
||||
0X2021 :
|
||||
0X2022 :
|
||||
0X2023 :
|
||||
0X2025 :
|
||||
0X2026 :
|
||||
0X2027 :
|
||||
0X2030 :
|
||||
0X2031 :
|
||||
0X2032 :
|
||||
0X2033 :
|
||||
0X2035 :
|
||||
0X2036 :
|
||||
0X2037 :
|
||||
0X2038 :
|
||||
0X2041 :
|
||||
0X2042 :
|
||||
0X2043 :
|
||||
0X2045 :
|
||||
0X2046 :
|
||||
0X2048 :
|
||||
0X2049 :
|
||||
0X0387 :
|
||||
*/
|
||||
|
||||
#if (defined(IS_LITTLE_ENDIAN) || ALU_SIZE == 16)
|
||||
// Precompiled CCMap for Big Endian(16bit)/Little Endian(16/32/64bit)
|
||||
/* 0000 */ 0x0030,0x0090,0x00C0,0x00E0,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0040,0x0020,0x0020,0x0050,0x0020,0x0060,0x0020,0x0070,
|
||||
0x0020,0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x0000,0x03EC,0x0000,0x0001,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0080,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0060 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0200,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0070 */ 0x01FD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0080 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0030,0x0001,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0090 */ 0x0020,0x0020,0x0020,0x00A0,0x0020,0x0020,0x0020,0x0020,
|
||||
0x00B0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00a0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x01FA,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00b0 */ 0x03BB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00c0 */ 0x00D0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00d0 */ 0x0000,0x0080,0x00EF,0x01EF,0x036E,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00e0 */ 0x00F0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00f0 */ 0x030E,0x03D3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
#elif (ALU_SIZE == 32)
|
||||
// Precompiled CCMap for Big Endian(32bit)
|
||||
/* 0000 */ 0x0030,0x0090,0x00C0,0x00E0,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0040,0x0020,0x0020,0x0050,0x0020,0x0060,0x0020,0x0070,
|
||||
0x0020,0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x0000,0x0000,0x03EC,0x0000,0x0001,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0080,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0060 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0200,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0070 */ 0x0000,0x01FD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0080 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0001,0x0030,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0090 */ 0x0020,0x0020,0x0020,0x00A0,0x0020,0x0020,0x0020,0x0020,
|
||||
0x00B0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00a0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x01FA,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00b0 */ 0x0000,0x03BB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00c0 */ 0x00D0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00d0 */ 0x0080,0x0000,0x01EF,0x00EF,0x0000,0x036E,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00e0 */ 0x00F0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00f0 */ 0x03D3,0x030E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
#elif (ALU_SIZE == 64)
|
||||
// Precompiled CCMap for Big Endian(64bit)
|
||||
/* 0000 */ 0x0030,0x0090,0x00C0,0x00E0,0x0010,0x0010,0x0010,0x0010,
|
||||
0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,0x0010,
|
||||
/* 0010 */ 0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0020 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0030 */ 0x0040,0x0020,0x0020,0x0050,0x0020,0x0060,0x0020,0x0070,
|
||||
0x0020,0x0080,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 0040 */ 0x0000,0x03EC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0001,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0050 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0080,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0060 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0200,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0070 */ 0x0000,0x0000,0x0000,0x01FD,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0080 */ 0x0000,0x0000,0x0000,0x0000,0x0001,0x0030,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 0090 */ 0x0020,0x0020,0x0020,0x00A0,0x0020,0x0020,0x0020,0x0020,
|
||||
0x00B0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00a0 */ 0x0000,0x0000,0x0000,0x0000,0x0000,0x01FA,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00b0 */ 0x0000,0x0000,0x0000,0x03BB,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00c0 */ 0x00D0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00d0 */ 0x01EF,0x00EF,0x0080,0x0000,0x0000,0x0000,0x0000,0x036E,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
/* 00e0 */ 0x00F0,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,0x0020,
|
||||
/* 00f0 */ 0x0000,0x0000,0x03D3,0x030E,0x0000,0x0000,0x0000,0x0000,
|
||||
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
|
||||
#else
|
||||
#error "We don't support this architecture."
|
||||
#endif
|
||||
|
Загрузка…
Ссылка в новой задаче