Lisp_Object table;
int min_byte1, max_byte1, min_byte2, max_byte2;
int c;
- struct charset *charset = (font_info->charset == charset_unicode
- ? NULL : CHARSET_FROM_ID (font_info->charset));
+ struct charset *charset = CHARSET_FROM_ID (font_info->charset);
+ int offset = CHARSET_OFFSET (charset);
table = Fmake_char_table (Qnil, Qnil);
if (min_byte1 == 0 && max_byte1 == 0)
{
if (! font->per_char || font->all_chars_exist == True)
- char_table_set_range (table, min_byte2, max_byte2, Qt);
+ {
+ if (offset >= 0)
+ char_table_set_range (table, offset + min_byte2,
+ offset + max_byte2, Qt);
+ else
+ for (; min_byte2 <= max_byte2; min_byte2++)
+ {
+ c = DECODE_CHAR (charset, min_byte2);
+ CHAR_TABLE_SET (table, c, Qt);
+ }
+ }
else
{
XCharStruct *pcm = font->per_char;
{
if (from >= 0)
{
- if (! charset)
- char_table_set_range (table, from, i - 1, Qt);
+ if (offset >= 0)
+ char_table_set_range (table, offset + from,
+ offset + i - 1, Qt);
else
for (; from < i; from++)
{
- c = ENCODE_CHAR (charset, from);
+ c = DECODE_CHAR (charset, from);
CHAR_TABLE_SET (table, c, Qt);
}
from = -1;
}
if (from >= 0)
{
- if (! charset)
- char_table_set_range (table, from, i - 1, Qt);
+ if (offset >= 0)
+ char_table_set_range (table, offset + from, offset + i - 1,
+ Qt);
else
for (; from < i; from++)
{
- c = ENCODE_CHAR (charset, from);
+ c = DECODE_CHAR (charset, from);
CHAR_TABLE_SET (table, c, Qt);
}
}
{
int i, j;
- if (! charset)
+ if (offset >= 0)
for (i = min_byte1; i <= max_byte1; i++)
- char_table_set_range (table,
- (i << 8) | min_byte2, (i << 8) | max_byte2,
- Qt);
+ char_table_set_range
+ (table, offset + ((i << 8) | min_byte2),
+ offset + ((i << 8) | max_byte2), Qt);
else
for (i = min_byte1; i <= max_byte1; i++)
for (j = min_byte2; j <= max_byte2; j++)
{
unsigned code = (i << 8) | j;
- c = ENCODE_CHAR (charset, code);
+ c = DECODE_CHAR (charset, code);
+ CHAR_TABLE_SET (table, c, Qt);
}
}
else
{
if (from >= 0)
{
- if (! charset)
- char_table_set_range (table, (i << 8) | from,
- (i << 8) | (j - 1), Qt);
+ if (offset >= 0)
+ char_table_set_range
+ (table, offset + ((i << 8) | from),
+ offset + ((i << 8) | (j - 1)), Qt);
else
{
for (; from < j; from++)
}
if (from >= 0)
{
- if (! charset)
- char_table_set_range (table, (i << 8) | from,
- (i << 8) | (j - 1), Qt);
+ if (offset >= 0)
+ char_table_set_range
+ (table, offset + ((i << 8) | from),
+ offset + ((i << 8) | (j - 1)), Qt);
else
{
for (; from < j; from++)
{
unsigned code = (i << 8) | from;
- c = ENCODE_CHAR (charset, code);
+ c = DECODE_CHAR (charset, code);
CHAR_TABLE_SET (table, c, Qt);
}
}