libkate: /home/v/Kate/WORK_TREES/kate-sorceress-backup/v/src/kate/src/kate_font.c Source File

- Main Page
- Related Pages
- Data Structures
- Files
- Examples

- File List

# /home/v/Kate/WORK_TREES/kate-sorceress-backup/v/src/kate/src/kate_font.c

    00001 /* Copyright (C) 2008 Vincent Penquerc'h.
    00002    This file is part of the Kate codec library.
    00003    Written by Vincent Penquerc'h.
    00004
    00005    Use, distribution and reproduction of this library is governed
    00006    by a BSD style source license included with this source in the
    00007    file 'COPYING'. Please read these terms before distributing. */
    00008
    00009
    00010 #define KATE_INTERNAL
    00011 #include "kate_internal.h"
    00012
    00013 #include "kate/kate.h"
    00014
    00023 int kate_font_get_index_from_code_point(const kate_font_mapping *kfm,int c)
    00024 {
    00025   size_t n;
    00026
    00027   if (!kfm) return KATE_E_INVALID_PARAMETER;
    00028   if (!kate_is_valid_code_point(c)) return KATE_E_TEXT;
    00029
    00030   for (n=0;n<kfm->nranges;++n) {
    00031     const kate_font_range *kfr=kfm->ranges[n];
    00032     if (c>=kfr->first_code_point && c<=kfr->last_code_point) {
    00033       return kfr->first_bitmap+c-kfr->first_code_point;
    00034     }
    00035   }
    00036
    00037   /* not found */
    00038   return KATE_E_NOT_FOUND;
    00039 }
    00040