| 1 |
/* Copyright (C) 2020-2023 Artifex Software, Inc. |
| 2 |
All Rights Reserved. |
| 3 |
|
| 4 |
This software is provided AS-IS with no warranty, either express or |
| 5 |
implied. |
| 6 |
|
| 7 |
This software is distributed under license and may not be copied, |
| 8 |
modified or distributed except as expressly authorized under the terms |
| 9 |
of the license contained in the file LICENSE in this distribution. |
| 10 |
|
| 11 |
Refer to licensing information at http://www.artifex.com or contact |
| 12 |
Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco, |
| 13 |
CA 94129, USA, for further information. |
| 14 |
*/ |
| 15 |
#ifndef PDF_CMAP_H |
| 16 |
#define PDF_CMAP_H |
| 17 |
|
| 18 |
#include "gxfcmap1.h" |
| 19 |
#include "pdf_font_types.h" |
| 20 |
|
| 21 |
/* Each pdfi_cmap_range_map_t allocations should include the |
| 22 |
* space required for the key and value strings, thus is |
| 23 |
* self contained, and avoids allocating lots of 1/2 byte |
| 24 |
* blocks |
| 25 |
*/ |
| 26 |
typedef struct pdfi_cmap_range_map_s pdfi_cmap_range_map_t; |
| 27 |
|
| 28 |
struct pdfi_cmap_range_map_s { |
| 29 |
gx_cmap_lookup_range_t range; |
| 30 |
pdfi_cmap_range_map_t *next; |
| 31 |
}; |
| 32 |
|
| 33 |
typedef struct pdfi_cmap_range_s pdfi_cmap_range_t; |
| 34 |
|
| 35 |
struct pdfi_cmap_range_s { |
| 36 |
pdfi_cmap_range_map_t *ranges; |
| 37 |
pdfi_cmap_range_map_t *ranges_tail; |
| 38 |
int numrangemaps; |
| 39 |
}; |
| 40 |
|
| 41 |
typedef struct pdf_cmap_s pdf_cmap; |
| 42 |
|
| 43 |
struct pdf_cmap_s |
| 44 |
{ |
| 45 |
pdf_obj_common; |
| 46 |
byte *buf; |
| 47 |
int buflen; |
| 48 |
int cmaptype; |
| 49 |
gs_string name; |
| 50 |
gs_string csi_reg; |
| 51 |
gs_string csi_ord; |
| 52 |
int csi_supplement; |
| 53 |
float vers; |
| 54 |
gs_uid uid; |
| 55 |
int wmode; |
| 56 |
gx_code_space_t code_space; |
| 57 |
pdfi_cmap_range_t cmap_range; |
| 58 |
pdfi_cmap_range_t notdef_cmap_range; |
| 59 |
gs_cmap_adobe1_t *gscmap; |
| 60 |
|
| 61 |
pdf_cmap *next; |
| 62 |
}; |
| 63 |
|
| 64 |
|
| 65 |
int |
| 66 |
pdfi_read_cmap(pdf_context *ctx, pdf_obj *cmap, pdf_cmap **pcmap); |
| 67 |
int |
| 68 |
pdfi_free_cmap(pdf_obj *cmapo); |
| 69 |
|
| 70 |
#endif /* PDF_CMAP_H */ |