File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 46
46
" struct_tree_spec.js" ,
47
47
" svg_factory_spec.js" ,
48
48
" text_layer_spec.js" ,
49
+ " to_unicode_map_spec.js" ,
49
50
" type1_parser_spec.js" ,
50
51
" ui_utils_spec.js" ,
51
52
" unicode_spec.js" ,
Original file line number Diff line number Diff line change
1
+ /* Copyright 2022 Mozilla Foundation
2
+ *
3
+ * Licensed under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License.
5
+ * You may obtain a copy of the License at
6
+ *
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ *
9
+ * Unless required by applicable law or agreed to in writing, software
10
+ * distributed under the License is distributed on an "AS IS" BASIS,
11
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ * See the License for the specific language governing permissions and
13
+ * limitations under the License.
14
+ */
15
+
16
+ import { ToUnicodeMap } from "../../src/core/to_unicode_map.js" ;
17
+
18
+ describe ( "ToUnicodeMap" , ( ) => {
19
+ it ( "should correctly map Extension B characters using codePointAt" , ( ) => {
20
+ const cmap = { 0x20 : "\uD840\uDC00" } ; // Example Extension B character
21
+ const toUnicodeMap = new ToUnicodeMap ( cmap ) ;
22
+
23
+ const expected = 0x20000 ; // Unicode code point for the character
24
+ let actual ;
25
+ toUnicodeMap . forEach ( ( charCode , unicode ) => {
26
+ if ( charCode === "32" ) {
27
+ // 0x20 in decimal
28
+ actual = unicode ;
29
+ }
30
+ } ) ;
31
+
32
+ expect ( actual ) . toBe ( expected ) ;
33
+ } ) ;
34
+ } ) ;
You can’t perform that action at this time.
0 commit comments