MuPDF X.Y.Z

pdf/cmap.h

Index

typedef

struct

macro

function

Cmap

macro PDF_MRANGE_CAP

#define PDF_MRANGE_CAP 256

struct pdf_range

struct pdf_range
{
        unsigned short low, high, out;
}

struct pdf_xrange

struct pdf_xrange
{
        unsigned int low, high, out;
}

struct pdf_mrange

struct pdf_mrange
{
        unsigned int low, out;
}

typedef pdf_cmap_splay

typedef struct pdf_cmap_splay pdf_cmap_splay

struct pdf_cmap

struct pdf_cmap
{
        fz_storable storable;
        char cmap_name[32];

        char usecmap_name[32];
        struct pdf_cmap *usecmap;

        int wmode;

        int codespace_len;
        struct
        {
                int n;
                unsigned int low;
                unsigned int high;
        } codespace[40];

        int rlen, rcap;
        pdf_range *ranges;

        int xlen, xcap;
        pdf_xrange *xranges;

        int mlen, mcap;
        pdf_mrange *mranges;

        fz_list(int, dict);

        int tree_top;
        fz_list(pdf_cmap_splay, tree);
}

function pdf_new_cmap

pdf_cmap *
pdf_new_cmap (
        fz_context *ctx
)

function pdf_keep_cmap

pdf_cmap *
pdf_keep_cmap (
        fz_context *ctx,
        pdf_cmap *cmap
)

function pdf_drop_cmap

void
pdf_drop_cmap (
        fz_context *ctx,
        pdf_cmap *cmap
)

function pdf_drop_cmap_imp

void
pdf_drop_cmap_imp (
        fz_context *ctx,
        fz_storable *cmap
)

function pdf_cmap_size

size_t
pdf_cmap_size (
        fz_context *ctx,
        pdf_cmap *cmap
)

function pdf_cmap_wmode

int
pdf_cmap_wmode (
        fz_context *ctx,
        pdf_cmap *cmap
)

function pdf_set_cmap_wmode

void
pdf_set_cmap_wmode (
        fz_context *ctx,
        pdf_cmap *cmap,
        int wmode
)

function pdf_set_usecmap

void
pdf_set_usecmap (
        fz_context *ctx,
        pdf_cmap *cmap,
        pdf_cmap *usecmap
)

function pdf_add_codespace

void
pdf_add_codespace (
        fz_context *ctx,
        pdf_cmap *cmap,
        unsigned int low,
        unsigned int high,
        size_t n
)

Add a codespacerange section. These ranges are used by pdf_decode_cmap to decode multi-byte encoded strings.

function pdf_map_range_to_range

void
pdf_map_range_to_range (
        fz_context *ctx,
        pdf_cmap *cmap,
        unsigned int srclo,
        unsigned int srchi,
        int dstlo
)

Add a range of contiguous one-to-one mappings (i.e. 1..5 maps to 21..25)

function pdf_map_one_to_many

void
pdf_map_one_to_many (
        fz_context *ctx,
        pdf_cmap *cmap,
        unsigned int one,
        int *many,
        size_t len
)

Add a single one-to-many mapping.

len <= 256.

function pdf_sort_cmap

void
pdf_sort_cmap (
        fz_context *ctx,
        pdf_cmap *cmap
)

function pdf_lookup_cmap

int
pdf_lookup_cmap (
        pdf_cmap *cmap,
        unsigned int cpt
)

Lookup the mapping of a codepoint.

function pdf_lookup_cmap_full

int
pdf_lookup_cmap_full (
        pdf_cmap *cmap,
        unsigned int cpt,
        int *out
)

function pdf_decode_cmap

int
pdf_decode_cmap (
        pdf_cmap *cmap,
        unsigned char *s,
        unsigned char *e,
        unsigned int *cpt
)

Use the codespace ranges to extract a codepoint from a multi-byte encoded string.

function pdf_new_identity_cmap

pdf_cmap *
pdf_new_identity_cmap (
        fz_context *ctx,
        int wmode,
        int bytes
)

Create an Identity-* CMap (for both 1 and 2-byte encodings)

function pdf_load_cmap

pdf_cmap *
pdf_load_cmap (
        fz_context *ctx,
        fz_stream *file
)

function pdf_load_system_cmap

pdf_cmap *
pdf_load_system_cmap (
        fz_context *ctx,
        const char *name
)

Load predefined CMap from system.

function pdf_load_builtin_cmap

pdf_cmap *
pdf_load_builtin_cmap (
        fz_context *ctx,
        const char *name
)

Load built-in CMap resource.

function pdf_load_embedded_cmap

pdf_cmap *
pdf_load_embedded_cmap (
        fz_context *ctx,
        pdf_document *doc,
        pdf_obj *ref
)

Load CMap stream in PDF file