- header = fill_gstring_header (Qnil, from, to, font_object, string);
+ if (NILP (string))
+ {
+ if (NILP (BVAR (current_buffer, enable_multibyte_characters)))
+ error ("Attempt to shape unibyte text");
+ validate_region (&from, &to);
+ frompos = XFASTINT (from);
+ topos = XFASTINT (to);
+ frombyte = CHAR_TO_BYTE (frompos);
+ }
+ else
+ {
+ CHECK_NATNUM (from);
+ CHECK_NATNUM (to);
+ CHECK_STRING (string);
+ if (! STRING_MULTIBYTE (string))
+ error ("Attempt to shape unibyte text");
+ if (! (XINT (from) <= XINT (to) && XINT (to) <= SCHARS (string)))
+ args_out_of_range_3 (string, from, to);
+ frompos = XFASTINT (from);
+ topos = XFASTINT (to);
+ frombyte = string_char_to_byte (string, frompos);
+ }
+
+ header = fill_gstring_header (Qnil, frompos, frombyte,
+ topos, font_object, string);