@rhwp/core 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,69 +1,259 @@
1
- # rhwp
1
+ # @rhwp/core
2
2
 
3
- **알(R), 모두의 한글** — HWP/HWPX 파일 파서 & 렌더러 (Rust + WebAssembly)
3
+ **알(R), 모두의 한글** — 브라우저에서 HWP 파일을 열어보세요
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@rhwp/core)](https://www.npmjs.com/package/@rhwp/core)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
- ## 설치
8
+ Rust + WebAssembly 기반 HWP/HWPX 파서 & 렌더러입니다.
9
+ HWP 파일을 파싱하고 SVG로 렌더링하는 저수준 API를 제공합니다.
10
+
11
+ > 편집 기능(메뉴, 툴바, 서식)이 필요하면 **[@rhwp/editor](https://www.npmjs.com/package/@rhwp/editor)** 를 사용하세요.
12
+ > 3줄이면 완전한 HWP 에디터를 임베드할 수 있습니다.
13
+
14
+ | 패키지 | 용도 |
15
+ |--------|------|
16
+ | **@rhwp/core** (이 패키지) | WASM 파서/렌더러 — 직접 API 호출 |
17
+ | **@rhwp/editor** | 완전한 에디터 UI — iframe 임베드 |
18
+
19
+ ## 빠른 시작 — 처음부터 따라하기
20
+
21
+ ### 1. 프로젝트 생성
9
22
 
10
23
  ```bash
24
+ mkdir my-hwp-viewer
25
+ cd my-hwp-viewer
26
+ npm init -y
11
27
  npm install @rhwp/core
28
+ npm install vite --save-dev
29
+ ```
30
+
31
+ ### 2. WASM 파일 복사
32
+
33
+ `@rhwp/core`에 포함된 WASM 바이너리를 웹 서버가 제공할 수 있는 위치에 복사합니다.
34
+
35
+ ```bash
36
+ mkdir public
37
+ cp node_modules/@rhwp/core/rhwp_bg.wasm public/
38
+ ```
39
+
40
+ ### 3. HTML 작성 — `index.html`
41
+
42
+ ```html
43
+ <!DOCTYPE html>
44
+ <html lang="ko">
45
+ <head>
46
+ <meta charset="UTF-8" />
47
+ <title>HWP 뷰어</title>
48
+ </head>
49
+ <body>
50
+ <h1>HWP 뷰어</h1>
51
+ <input type="file" id="file-input" accept=".hwp,.hwpx" />
52
+ <p id="status">파일을 선택해주세요.</p>
53
+ <div id="viewer"></div>
54
+ <script type="module" src="/main.js"></script>
55
+ </body>
56
+ </html>
12
57
  ```
13
58
 
14
- ## 사용법
59
+ ### 4. JavaScript 작성 — `main.js`
15
60
 
16
61
  ```javascript
17
62
  import init, { HwpDocument } from '@rhwp/core';
18
63
 
19
- // WASM 초기화
20
- await init();
64
+ // 텍스트 폭 측정 함수 등록 (필수 — 아래 "왜 필요한가?" 참고)
65
+ let ctx = null;
66
+ let lastFont = '';
67
+ globalThis.measureTextWidth = (font, text) => {
68
+ if (!ctx) ctx = document.createElement('canvas').getContext('2d');
69
+ if (font !== lastFont) { ctx.font = font; lastFont = font; }
70
+ return ctx.measureText(text).width;
71
+ };
21
72
 
22
- // HWP 파일 로드
23
- const response = await fetch('document.hwp');
24
- const buffer = new Uint8Array(await response.arrayBuffer());
25
- const doc = HwpDocument.load(buffer, 'document.hwp');
73
+ // WASM 초기화
74
+ await init({ module_or_path: '/rhwp_bg.wasm' });
75
+ document.getElementById('status').textContent = '준비 완료!';
26
76
 
27
- // 문서 정보
28
- console.log(doc.pageCount);
77
+ // 파일 선택 시 렌더링
78
+ document.getElementById('file-input').addEventListener('change', async (e) => {
79
+ const file = e.target.files[0];
80
+ if (!file) return;
29
81
 
30
- // SVG 렌더링
31
- const svg = doc.renderPageToSvg(0); // 첫 번째 페이지
32
- document.getElementById('viewer').innerHTML = svg;
82
+ const buffer = new Uint8Array(await file.arrayBuffer());
83
+ const doc = new HwpDocument(buffer);
84
+
85
+ // SVG로 첫 페이지 렌더링
86
+ const svg = doc.renderPageSvg(0);
87
+ document.getElementById('viewer').innerHTML = svg;
88
+ document.getElementById('status').textContent =
89
+ `${file.name} — ${doc.pageCount()}페이지`;
90
+ });
33
91
  ```
34
92
 
35
- ## Canvas 렌더링
93
+ ### 5. 실행
94
+
95
+ ```bash
96
+ npx vite --port 3000
97
+ ```
98
+
99
+ 브라우저에서 `http://localhost:3000` 을 열고 HWP 파일을 선택하면 렌더링됩니다.
100
+
101
+ ## API
102
+
103
+ ### 초기화
36
104
 
37
105
  ```javascript
38
106
  import init, { HwpDocument } from '@rhwp/core';
107
+ await init({ module_or_path: '/rhwp_bg.wasm' });
108
+ ```
109
+
110
+ ### 문서 로드
39
111
 
40
- await init();
41
- const doc = HwpDocument.load(buffer, 'document.hwp');
112
+ ```javascript
113
+ // 파일 입력에서 로드
114
+ const doc = new HwpDocument(new Uint8Array(buffer));
42
115
 
43
- // Canvas에 렌더링
44
- const canvas = document.getElementById('canvas');
45
- const ctx = canvas.getContext('2d');
46
- doc.renderPageToCanvas(0, ctx, canvas.width, canvas.height);
116
+ // fetch로 로드
117
+ const resp = await fetch('/sample.hwp');
118
+ const doc = new HwpDocument(new Uint8Array(await resp.arrayBuffer()));
47
119
  ```
48
120
 
49
- ## 기능
121
+ ### SVG 렌더링
122
+
123
+ ```javascript
124
+ const svg = doc.renderPageSvg(0); // 첫 페이지
125
+ document.getElementById('viewer').innerHTML = svg;
126
+ ```
127
+
128
+ ### 페이지 네비게이션
129
+
130
+ ```javascript
131
+ const total = doc.pageCount();
132
+ for (let i = 0; i < total; i++) {
133
+ const svg = doc.renderPageSvg(i);
134
+ // ...
135
+ }
136
+ ```
137
+
138
+ ## 필수 설정: measureTextWidth
139
+
140
+ WASM 내부에서 텍스트 레이아웃(줄바꿈, 정렬 등)을 계산할 때
141
+ 브라우저의 Canvas 텍스트 측정 API가 필요합니다.
142
+ **WASM 초기화 전에 반드시 등록**해야 합니다.
143
+
144
+ ```javascript
145
+ let ctx = null;
146
+ let lastFont = '';
147
+ globalThis.measureTextWidth = (font, text) => {
148
+ if (!ctx) ctx = document.createElement('canvas').getContext('2d');
149
+ if (font !== lastFont) { ctx.font = font; lastFont = font; }
150
+ return ctx.measureText(text).width;
151
+ };
152
+ ```
153
+
154
+ ### 왜 필요한가?
155
+
156
+ HWP 문서의 텍스트 배치(줄바꿈 위치, 양쪽 정렬 간격)를 정확하게 계산하려면
157
+ 각 글자의 실제 렌더링 폭을 알아야 합니다.
158
+ WASM 내부에는 브라우저 폰트에 접근할 수 없으므로,
159
+ JavaScript의 `Canvas.measureText()`를 콜백으로 호출합니다.
160
+
161
+ ## 폰트 설정 가이드
162
+
163
+ ### SVG 렌더링과 폰트
164
+
165
+ `renderPageSvg()`가 생성하는 SVG는 CSS `font-family` 속성으로 폰트를 지정합니다.
166
+ HWP 문서에서 사용된 폰트(한컴바탕, HY명조 등)가 사용자 환경에 없으면 **글자가 대체 폰트로 표시**되어 줄 바꿈 위치나 글자 간격이 원본과 달라질 수 있습니다.
167
+
168
+ ### 권장: 오픈소스 폴백 폰트 로드
169
+
170
+ rhwp는 한컴 전용 폰트를 오픈소스 폰트로 자동 폴백합니다. 아래 폰트를 웹페이지에 로드하면 대부분의 HWP 문서를 원본에 가깝게 렌더링할 수 있습니다.
171
+
172
+ ```html
173
+ <!-- Google Fonts CDN -->
174
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;700&family=Noto+Serif+KR:wght@400;700&family=Nanum+Gothic&family=Nanum+Myeongjo&display=swap">
175
+ ```
176
+
177
+ 또는 셀프 호스팅:
178
+
179
+ ```css
180
+ @font-face {
181
+ font-family: 'Pretendard';
182
+ src: url('/fonts/Pretendard-Regular.woff2') format('woff2');
183
+ font-weight: 400;
184
+ }
185
+ @font-face {
186
+ font-family: 'Pretendard';
187
+ src: url('/fonts/Pretendard-Bold.woff2') format('woff2');
188
+ font-weight: 700;
189
+ }
190
+ ```
191
+
192
+ ### 폰트 폴백 매핑
193
+
194
+ rhwp가 SVG에 적용하는 자동 폴백 체인:
195
+
196
+ | HWP 원본 폰트 | 폴백 1 | 폴백 2 | 폴백 3 |
197
+ |--------------|--------|--------|--------|
198
+ | 한컴바탕, HY명조 | Noto Serif KR | 나눔명조 | serif |
199
+ | 한컴돋움, HY고딕 | Noto Sans KR | 나눔고딕 | sans-serif |
200
+ | 함초롬바탕 | Noto Serif KR | 나눔명조 | serif |
201
+ | 함초롬돋움 | Pretendard | Noto Sans KR | sans-serif |
202
+ | 맑은 고딕 | Pretendard | Noto Sans KR | sans-serif |
203
+ | Arial, Calibri | Pretendard | sans-serif | — |
204
+ | Times New Roman | Noto Serif KR | serif | — |
205
+ | 바탕, 궁서 | Noto Serif KR | serif | — |
206
+ | 돋움, 굴림 | Noto Sans KR | sans-serif | — |
207
+
208
+ ### 폰트 없이도 동작합니다
209
+
210
+ 폴백 폰트를 로드하지 않아도 SVG는 정상적으로 렌더링됩니다. 브라우저의 기본 serif/sans-serif 폰트가 사용되며, 글자 간격이 원본과 다소 다를 수 있습니다.
211
+
212
+ ## 지원 기능
50
213
 
51
214
  - **HWP 5.0** (바이너리) + **HWPX** (XML) 파싱
52
- - 문단, 표, 수식, 이미지, 차트 렌더링
53
- - 페이지네이션 (다단, 표 분할)
54
- - SVG / Canvas 출력
55
- - 머리말/꼬리말/바탕쪽/각주
215
+ - 문단, 표, 수식, 이미지, 차트, 도형 렌더링
216
+ - 페이지네이션 (다단, 표 분할)
217
+ - 그림 자르기(crop), 이미지 테두리선
218
+ - SVG 출력
219
+ - 머리말/꼬리말/바탕쪽/각주/미주
56
220
 
57
221
  ## 링크
58
222
 
59
- - [온라인 데모](https://edwardkim.github.io/rhwp/)
60
- - [GitHub](https://github.com/edwardkim/rhwp)
61
- - [VS Code 확장](https://marketplace.visualstudio.com/items?itemName=edwardkim.rhwp-vscode)
223
+ - **[온라인 데모](https://edwardkim.github.io/rhwp/)**
224
+ - **[GitHub](https://github.com/edwardkim/rhwp)**
225
+ - **[@rhwp/editor](https://www.npmjs.com/package/@rhwp/editor)** — 에디터 UI 임베드
226
+ - **[VS Code 확장](https://marketplace.visualstudio.com/items?itemName=edwardkim.rhwp-vscode)**
227
+
228
+ ## Third-Party Licenses
229
+
230
+ 이 패키지는 다음 오픈소스 Rust 크레이트를 WASM으로 컴파일하여 포함합니다.
231
+
232
+ | 크레이트 | 라이선스 |
233
+ |---------|---------|
234
+ | wasm-bindgen / web-sys / js-sys | MIT OR Apache-2.0 |
235
+ | quick-xml | MIT |
236
+ | cfb | MIT |
237
+ | flate2 | MIT OR Apache-2.0 |
238
+ | encoding_rs | (Apache-2.0 OR MIT) AND BSD-3-Clause |
239
+ | usvg / svg2pdf | Apache-2.0 OR MIT |
240
+ | pdf-writer | MIT OR Apache-2.0 |
241
+ | unicode-segmentation / unicode-width | MIT OR Apache-2.0 |
242
+ | image | MIT OR Apache-2.0 |
243
+
244
+ 전체 목록: [THIRD_PARTY_LICENSES.md](https://github.com/edwardkim/rhwp/blob/main/THIRD_PARTY_LICENSES.md)
245
+
246
+ > 모든 의존성은 MIT 라이선스와 호환됩니다.
62
247
 
63
248
  ## Notice
64
249
 
65
250
  본 제품은 한글과컴퓨터의 한글 문서 파일(.hwp) 공개 문서를 참고하여 개발하였습니다.
66
251
 
252
+ ## Trademark
253
+
254
+ "한글", "한컴", "HWP", "HWPX"는 주식회사 한글과컴퓨터의 등록 상표입니다.
255
+ 본 패키지는 한글과컴퓨터와 제휴, 후원, 승인 관계가 없는 독립적인 오픈소스 프로젝트입니다.
256
+
67
257
  ## License
68
258
 
69
259
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhwp/core",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "HWP/HWPX file parser and renderer — Rust + WebAssembly",
5
5
  "type": "module",
6
6
  "main": "rhwp.js",
package/rhwp.d.ts CHANGED
@@ -1218,6 +1218,8 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
1218
1218
 
1219
1219
  export interface InitOutput {
1220
1220
  readonly memory: WebAssembly.Memory;
1221
+ readonly version: () => [number, number];
1222
+ readonly init_panic_hook: () => void;
1221
1223
  readonly __wbg_hwpdocument_free: (a: number, b: number) => void;
1222
1224
  readonly __wbg_hwpviewer_free: (a: number, b: number) => void;
1223
1225
  readonly hwpdocument_addBookmark: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
@@ -1458,8 +1460,6 @@ export interface InitOutput {
1458
1460
  readonly hwpviewer_updateViewport: (a: number, b: number, c: number, d: number, e: number) => void;
1459
1461
  readonly hwpviewer_visiblePages: (a: number) => [number, number];
1460
1462
  readonly hwpviewer_pageCount: (a: number) => number;
1461
- readonly version: () => [number, number];
1462
- readonly init_panic_hook: () => void;
1463
1463
  readonly __wbindgen_exn_store: (a: number) => void;
1464
1464
  readonly __externref_table_alloc: () => number;
1465
1465
  readonly __wbindgen_externrefs: WebAssembly.Table;
package/rhwp.js CHANGED
@@ -5587,65 +5587,65 @@ export function version() {
5587
5587
  function __wbg_get_imports() {
5588
5588
  const import0 = {
5589
5589
  __proto__: null,
5590
- __wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
5590
+ __wbg___wbindgen_is_undefined_87a3a837f331fef5: function(arg0) {
5591
5591
  const ret = arg0 === undefined;
5592
5592
  return ret;
5593
5593
  },
5594
- __wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
5594
+ __wbg___wbindgen_throw_5549492daedad139: function(arg0, arg1) {
5595
5595
  throw new Error(getStringFromWasm0(arg0, arg1));
5596
5596
  },
5597
- __wbg_addColorStop_7838a3cd5e06abf1: function() { return handleError(function (arg0, arg1, arg2, arg3) {
5597
+ __wbg_addColorStop_e9d7917e602ba786: function() { return handleError(function (arg0, arg1, arg2, arg3) {
5598
5598
  arg0.addColorStop(arg1, getStringFromWasm0(arg2, arg3));
5599
5599
  }, arguments); },
5600
- __wbg_arcTo_4952f0a643175f27: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
5600
+ __wbg_arcTo_a58bf97d6156a7d5: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
5601
5601
  arg0.arcTo(arg1, arg2, arg3, arg4, arg5);
5602
5602
  }, arguments); },
5603
- __wbg_arc_a01205d471446260: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
5603
+ __wbg_arc_5f0ea790e460e7f8: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
5604
5604
  arg0.arc(arg1, arg2, arg3, arg4, arg5);
5605
5605
  }, arguments); },
5606
- __wbg_beginPath_a1e53d163e17614b: function(arg0) {
5606
+ __wbg_beginPath_d19446eab1bb1877: function(arg0) {
5607
5607
  arg0.beginPath();
5608
5608
  },
5609
- __wbg_bezierCurveTo_efe5b7b8358a89ec: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
5609
+ __wbg_bezierCurveTo_b5cebd2f15e81c18: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
5610
5610
  arg0.bezierCurveTo(arg1, arg2, arg3, arg4, arg5, arg6);
5611
5611
  },
5612
- __wbg_clip_5451abac85dafc5b: function(arg0) {
5612
+ __wbg_clip_33350cb2b008c756: function(arg0) {
5613
5613
  arg0.clip();
5614
5614
  },
5615
- __wbg_closePath_2995ab1cdf3f4741: function(arg0) {
5615
+ __wbg_closePath_75c0f615995df9cf: function(arg0) {
5616
5616
  arg0.closePath();
5617
5617
  },
5618
- __wbg_complete_9c7e8398a74ac445: function(arg0) {
5618
+ __wbg_complete_209738f7e96f09fe: function(arg0) {
5619
5619
  const ret = arg0.complete;
5620
5620
  return ret;
5621
5621
  },
5622
- __wbg_createElement_8640e331213b402e: function() { return handleError(function (arg0, arg1, arg2) {
5622
+ __wbg_createElement_a8dcfa25dbf80c51: function() { return handleError(function (arg0, arg1, arg2) {
5623
5623
  const ret = arg0.createElement(getStringFromWasm0(arg1, arg2));
5624
5624
  return ret;
5625
5625
  }, arguments); },
5626
- __wbg_createLinearGradient_ab028d15952b6091: function(arg0, arg1, arg2, arg3, arg4) {
5626
+ __wbg_createLinearGradient_160436063f36af0f: function(arg0, arg1, arg2, arg3, arg4) {
5627
5627
  const ret = arg0.createLinearGradient(arg1, arg2, arg3, arg4);
5628
5628
  return ret;
5629
5629
  },
5630
- __wbg_createPattern_717efe2bd2276276: function() { return handleError(function (arg0, arg1, arg2, arg3) {
5630
+ __wbg_createPattern_f1fdc22be0e288a9: function() { return handleError(function (arg0, arg1, arg2, arg3) {
5631
5631
  const ret = arg0.createPattern(arg1, getStringFromWasm0(arg2, arg3));
5632
5632
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
5633
5633
  }, arguments); },
5634
- __wbg_createRadialGradient_fec727ae86035c9d: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
5634
+ __wbg_createRadialGradient_f65b83baea8ac2db: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
5635
5635
  const ret = arg0.createRadialGradient(arg1, arg2, arg3, arg4, arg5, arg6);
5636
5636
  return ret;
5637
5637
  }, arguments); },
5638
- __wbg_document_a28a21ae315de4ea: function(arg0) {
5638
+ __wbg_document_cf512e4e2300751d: function(arg0) {
5639
5639
  const ret = arg0.document;
5640
5640
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
5641
5641
  },
5642
- __wbg_drawImage_6fc7a96d344d7199: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
5643
- arg0.drawImage(arg1, arg2, arg3, arg4, arg5);
5644
- }, arguments); },
5645
- __wbg_drawImage_b315346e733a5afb: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
5642
+ __wbg_drawImage_0fe07c153adefab9: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
5646
5643
  arg0.drawImage(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
5647
5644
  }, arguments); },
5648
- __wbg_ellipse_9a16e4a09b67f93b: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
5645
+ __wbg_drawImage_3bd75ebb4b2d9e3a: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
5646
+ arg0.drawImage(arg1, arg2, arg3, arg4, arg5);
5647
+ }, arguments); },
5648
+ __wbg_ellipse_f62a7677aa5a6d10: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
5649
5649
  arg0.ellipse(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
5650
5650
  }, arguments); },
5651
5651
  __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
@@ -5659,24 +5659,24 @@ function __wbg_get_imports() {
5659
5659
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
5660
5660
  }
5661
5661
  },
5662
- __wbg_fillRect_a7f9306dd4dccb50: function(arg0, arg1, arg2, arg3, arg4) {
5662
+ __wbg_fillRect_8e85439dbed5cf52: function(arg0, arg1, arg2, arg3, arg4) {
5663
5663
  arg0.fillRect(arg1, arg2, arg3, arg4);
5664
5664
  },
5665
- __wbg_fillText_74f2fec94a63d2bb: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
5665
+ __wbg_fillText_cbd6bbed4f2bdb60: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
5666
5666
  arg0.fillText(getStringFromWasm0(arg1, arg2), arg3, arg4);
5667
5667
  }, arguments); },
5668
- __wbg_fill_f32839c7afadf949: function(arg0) {
5668
+ __wbg_fill_dae36238515d5017: function(arg0) {
5669
5669
  arg0.fill();
5670
5670
  },
5671
- __wbg_getContext_8f1ff363618c55da: function() { return handleError(function (arg0, arg1, arg2) {
5671
+ __wbg_getContext_749c4678f6cac6fb: function() { return handleError(function (arg0, arg1, arg2) {
5672
5672
  const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
5673
5673
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
5674
5674
  }, arguments); },
5675
- __wbg_height_734034c3ff2654af: function(arg0) {
5675
+ __wbg_height_2393a7383c1f4485: function(arg0) {
5676
5676
  const ret = arg0.height;
5677
5677
  return ret;
5678
5678
  },
5679
- __wbg_instanceof_CanvasRenderingContext2d_f09a103e0ca31fb4: function(arg0) {
5679
+ __wbg_instanceof_CanvasRenderingContext2d_05c92edaf1c9546d: function(arg0) {
5680
5680
  let result;
5681
5681
  try {
5682
5682
  result = arg0 instanceof CanvasRenderingContext2D;
@@ -5686,7 +5686,7 @@ function __wbg_get_imports() {
5686
5686
  const ret = result;
5687
5687
  return ret;
5688
5688
  },
5689
- __wbg_instanceof_HtmlCanvasElement_3cec11b30b0d54e4: function(arg0) {
5689
+ __wbg_instanceof_HtmlCanvasElement_14482979108c6cf8: function(arg0) {
5690
5690
  let result;
5691
5691
  try {
5692
5692
  result = arg0 instanceof HTMLCanvasElement;
@@ -5696,7 +5696,7 @@ function __wbg_get_imports() {
5696
5696
  const ret = result;
5697
5697
  return ret;
5698
5698
  },
5699
- __wbg_instanceof_Window_c0fee4c064502536: function(arg0) {
5699
+ __wbg_instanceof_Window_2fa8d9c2d5b6104a: function(arg0) {
5700
5700
  let result;
5701
5701
  try {
5702
5702
  result = arg0 instanceof Window;
@@ -5706,17 +5706,17 @@ function __wbg_get_imports() {
5706
5706
  const ret = result;
5707
5707
  return ret;
5708
5708
  },
5709
- __wbg_lineTo_7681b84260d7196b: function(arg0, arg1, arg2) {
5709
+ __wbg_lineTo_8bf70bb6798a8c99: function(arg0, arg1, arg2) {
5710
5710
  arg0.lineTo(arg1, arg2);
5711
5711
  },
5712
5712
  __wbg_measureTextWidth_8a74d4420413fe6e: function(arg0, arg1, arg2, arg3) {
5713
5713
  const ret = globalThis.measureTextWidth(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
5714
5714
  return ret;
5715
5715
  },
5716
- __wbg_moveTo_cddeee6b0d0c4ef5: function(arg0, arg1, arg2) {
5716
+ __wbg_moveTo_80cc3e7e4d56242c: function(arg0, arg1, arg2) {
5717
5717
  arg0.moveTo(arg1, arg2);
5718
5718
  },
5719
- __wbg_naturalWidth_bd04449177fd0c7b: function(arg0) {
5719
+ __wbg_naturalWidth_9386aa07e577c907: function(arg0) {
5720
5720
  const ret = arg0.naturalWidth;
5721
5721
  return ret;
5722
5722
  },
@@ -5724,88 +5724,88 @@ function __wbg_get_imports() {
5724
5724
  const ret = new Error();
5725
5725
  return ret;
5726
5726
  },
5727
- __wbg_new_84748f0feee3d22f: function() { return handleError(function () {
5728
- const ret = new Image();
5729
- return ret;
5730
- }, arguments); },
5731
- __wbg_new_f3c9df4f38f3f798: function() {
5727
+ __wbg_new_4370be21fa2b2f80: function() {
5732
5728
  const ret = new Array();
5733
5729
  return ret;
5734
5730
  },
5735
- __wbg_push_6bdbc990be5ac37b: function(arg0, arg1) {
5731
+ __wbg_new_492a3832e7a76b37: function() { return handleError(function () {
5732
+ const ret = new Image();
5733
+ return ret;
5734
+ }, arguments); },
5735
+ __wbg_push_d0006a37f9fcda6d: function(arg0, arg1) {
5736
5736
  const ret = arg0.push(arg1);
5737
5737
  return ret;
5738
5738
  },
5739
- __wbg_quadraticCurveTo_80a0cac31f3c97d5: function(arg0, arg1, arg2, arg3, arg4) {
5739
+ __wbg_quadraticCurveTo_d640ca60151c694c: function(arg0, arg1, arg2, arg3, arg4) {
5740
5740
  arg0.quadraticCurveTo(arg1, arg2, arg3, arg4);
5741
5741
  },
5742
- __wbg_rect_a62412d60d0bcfe7: function(arg0, arg1, arg2, arg3, arg4) {
5742
+ __wbg_rect_116aaad8434d86e0: function(arg0, arg1, arg2, arg3, arg4) {
5743
5743
  arg0.rect(arg1, arg2, arg3, arg4);
5744
5744
  },
5745
- __wbg_restore_512447a0078b165e: function(arg0) {
5745
+ __wbg_restore_e6a24ab91175f69b: function(arg0) {
5746
5746
  arg0.restore();
5747
5747
  },
5748
- __wbg_rotate_900633026d37af8d: function() { return handleError(function (arg0, arg1) {
5748
+ __wbg_rotate_a2ecf4b4abce0381: function() { return handleError(function (arg0, arg1) {
5749
5749
  arg0.rotate(arg1);
5750
5750
  }, arguments); },
5751
- __wbg_save_a345c60472a6c85a: function(arg0) {
5751
+ __wbg_save_79d7c437f5eee0f4: function(arg0) {
5752
5752
  arg0.save();
5753
5753
  },
5754
- __wbg_scale_d80ed0b793d7a928: function() { return handleError(function (arg0, arg1, arg2) {
5754
+ __wbg_scale_050b84c93a084b76: function() { return handleError(function (arg0, arg1, arg2) {
5755
5755
  arg0.scale(arg1, arg2);
5756
5756
  }, arguments); },
5757
- __wbg_setLineDash_1efc2f7f902aa644: function() { return handleError(function (arg0, arg1) {
5757
+ __wbg_setLineDash_6f5cc2a22c4a1b91: function() { return handleError(function (arg0, arg1) {
5758
5758
  arg0.setLineDash(arg1);
5759
5759
  }, arguments); },
5760
- __wbg_set_fillStyle_06ca63831e299ec6: function(arg0, arg1, arg2) {
5761
- arg0.fillStyle = getStringFromWasm0(arg1, arg2);
5762
- },
5763
- __wbg_set_fillStyle_7020c23cef17ae89: function(arg0, arg1) {
5760
+ __wbg_set_fillStyle_2028dbddef59161a: function(arg0, arg1) {
5764
5761
  arg0.fillStyle = arg1;
5765
5762
  },
5766
- __wbg_set_fillStyle_76ebff6831ea9a88: function(arg0, arg1) {
5763
+ __wbg_set_fillStyle_5546a7d5a3c3b858: function(arg0, arg1) {
5767
5764
  arg0.fillStyle = arg1;
5768
5765
  },
5769
- __wbg_set_font_1cb7225ed52d9f14: function(arg0, arg1, arg2) {
5766
+ __wbg_set_fillStyle_5831c43ae72fcbaa: function(arg0, arg1, arg2) {
5767
+ arg0.fillStyle = getStringFromWasm0(arg1, arg2);
5768
+ },
5769
+ __wbg_set_font_b66425253b4ba1d9: function(arg0, arg1, arg2) {
5770
5770
  arg0.font = getStringFromWasm0(arg1, arg2);
5771
5771
  },
5772
- __wbg_set_globalAlpha_5aec89813a61973c: function(arg0, arg1) {
5772
+ __wbg_set_globalAlpha_fa591e18100bfc5b: function(arg0, arg1) {
5773
5773
  arg0.globalAlpha = arg1;
5774
5774
  },
5775
- __wbg_set_height_26ab95ff99e2b620: function(arg0, arg1) {
5775
+ __wbg_set_height_281ab7665c19410b: function(arg0, arg1) {
5776
5776
  arg0.height = arg1 >>> 0;
5777
5777
  },
5778
- __wbg_set_lineCap_b6e1677f577e962e: function(arg0, arg1, arg2) {
5778
+ __wbg_set_lineCap_93be14274c7e6eee: function(arg0, arg1, arg2) {
5779
5779
  arg0.lineCap = getStringFromWasm0(arg1, arg2);
5780
5780
  },
5781
- __wbg_set_lineWidth_b403909aac47bdf0: function(arg0, arg1) {
5781
+ __wbg_set_lineWidth_8a79face29b28dee: function(arg0, arg1) {
5782
5782
  arg0.lineWidth = arg1;
5783
5783
  },
5784
- __wbg_set_shadowBlur_803e1c05466b06c1: function(arg0, arg1) {
5784
+ __wbg_set_shadowBlur_54b44d6aec89c7ec: function(arg0, arg1) {
5785
5785
  arg0.shadowBlur = arg1;
5786
5786
  },
5787
- __wbg_set_shadowColor_74c62aada87854db: function(arg0, arg1, arg2) {
5787
+ __wbg_set_shadowColor_3ba720a5fa43c12b: function(arg0, arg1, arg2) {
5788
5788
  arg0.shadowColor = getStringFromWasm0(arg1, arg2);
5789
5789
  },
5790
- __wbg_set_shadowOffsetX_513152482ef2ab1b: function(arg0, arg1) {
5790
+ __wbg_set_shadowOffsetX_56967f53265f18d2: function(arg0, arg1) {
5791
5791
  arg0.shadowOffsetX = arg1;
5792
5792
  },
5793
- __wbg_set_shadowOffsetY_1aa4ef4e5d2e7823: function(arg0, arg1) {
5793
+ __wbg_set_shadowOffsetY_26775f75389ab264: function(arg0, arg1) {
5794
5794
  arg0.shadowOffsetY = arg1;
5795
5795
  },
5796
- __wbg_set_src_5d34b11a5c99434b: function(arg0, arg1, arg2) {
5796
+ __wbg_set_src_5c8f7756bc7b1460: function(arg0, arg1, arg2) {
5797
5797
  arg0.src = getStringFromWasm0(arg1, arg2);
5798
5798
  },
5799
- __wbg_set_strokeStyle_86e8cc93fb4bd2db: function(arg0, arg1, arg2) {
5799
+ __wbg_set_strokeStyle_27efebf6589caeff: function(arg0, arg1, arg2) {
5800
5800
  arg0.strokeStyle = getStringFromWasm0(arg1, arg2);
5801
5801
  },
5802
- __wbg_set_textAlign_e124c6a98f20f112: function(arg0, arg1, arg2) {
5802
+ __wbg_set_textAlign_78fce947b83e7cf8: function(arg0, arg1, arg2) {
5803
5803
  arg0.textAlign = getStringFromWasm0(arg1, arg2);
5804
5804
  },
5805
- __wbg_set_textBaseline_3680ec3c0053a436: function(arg0, arg1, arg2) {
5805
+ __wbg_set_textBaseline_5b55527990589666: function(arg0, arg1, arg2) {
5806
5806
  arg0.textBaseline = getStringFromWasm0(arg1, arg2);
5807
5807
  },
5808
- __wbg_set_width_81fa781e87b17891: function(arg0, arg1) {
5808
+ __wbg_set_width_2b175fb691e65ee4: function(arg0, arg1) {
5809
5809
  arg0.width = arg1 >>> 0;
5810
5810
  },
5811
5811
  __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
@@ -5815,35 +5815,35 @@ function __wbg_get_imports() {
5815
5815
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
5816
5816
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
5817
5817
  },
5818
- __wbg_static_accessor_GLOBAL_THIS_a1248013d790bf5f: function() {
5819
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
5818
+ __wbg_static_accessor_GLOBAL_8dfb7f5e26ebe523: function() {
5819
+ const ret = typeof global === 'undefined' ? null : global;
5820
5820
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
5821
5821
  },
5822
- __wbg_static_accessor_GLOBAL_f2e0f995a21329ff: function() {
5823
- const ret = typeof global === 'undefined' ? null : global;
5822
+ __wbg_static_accessor_GLOBAL_THIS_941154efc8395cdd: function() {
5823
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
5824
5824
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
5825
5825
  },
5826
- __wbg_static_accessor_SELF_24f78b6d23f286ea: function() {
5826
+ __wbg_static_accessor_SELF_58dac9af822f561f: function() {
5827
5827
  const ret = typeof self === 'undefined' ? null : self;
5828
5828
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
5829
5829
  },
5830
- __wbg_static_accessor_WINDOW_59fd959c540fe405: function() {
5830
+ __wbg_static_accessor_WINDOW_ee64f0b3d8354c0b: function() {
5831
5831
  const ret = typeof window === 'undefined' ? null : window;
5832
5832
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
5833
5833
  },
5834
- __wbg_strokeRect_de27ebfce0d53872: function(arg0, arg1, arg2, arg3, arg4) {
5834
+ __wbg_strokeRect_3dde9d625c426790: function(arg0, arg1, arg2, arg3, arg4) {
5835
5835
  arg0.strokeRect(arg1, arg2, arg3, arg4);
5836
5836
  },
5837
- __wbg_strokeText_20598a08b7e2a7b1: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
5837
+ __wbg_strokeText_c26a5decb92fae61: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
5838
5838
  arg0.strokeText(getStringFromWasm0(arg1, arg2), arg3, arg4);
5839
5839
  }, arguments); },
5840
- __wbg_stroke_ec05fb6fc31115a7: function(arg0) {
5840
+ __wbg_stroke_973b13cddda4b497: function(arg0) {
5841
5841
  arg0.stroke();
5842
5842
  },
5843
- __wbg_translate_64d7e09091d88205: function() { return handleError(function (arg0, arg1, arg2) {
5843
+ __wbg_translate_c1935f09d8177ca2: function() { return handleError(function (arg0, arg1, arg2) {
5844
5844
  arg0.translate(arg1, arg2);
5845
5845
  }, arguments); },
5846
- __wbg_width_80cea93fc7f63070: function(arg0) {
5846
+ __wbg_width_c2ed6178eeb4ed9f: function(arg0) {
5847
5847
  const ret = arg0.width;
5848
5848
  return ret;
5849
5849
  },
package/rhwp_bg.wasm CHANGED
Binary file
package/rhwp_bg.wasm.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
+ export const version: () => [number, number];
5
+ export const init_panic_hook: () => void;
4
6
  export const __wbg_hwpdocument_free: (a: number, b: number) => void;
5
7
  export const __wbg_hwpviewer_free: (a: number, b: number) => void;
6
8
  export const hwpdocument_addBookmark: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
@@ -241,8 +243,6 @@ export const hwpviewer_setZoom: (a: number, b: number) => void;
241
243
  export const hwpviewer_updateViewport: (a: number, b: number, c: number, d: number, e: number) => void;
242
244
  export const hwpviewer_visiblePages: (a: number) => [number, number];
243
245
  export const hwpviewer_pageCount: (a: number) => number;
244
- export const version: () => [number, number];
245
- export const init_panic_hook: () => void;
246
246
  export const __wbindgen_exn_store: (a: number) => void;
247
247
  export const __externref_table_alloc: () => number;
248
248
  export const __wbindgen_externrefs: WebAssembly.Table;