diff --git a/source/texk/web2c/luatexdir/font/dofont.c b/source/texk/web2c/luatexdir/font/dofont.c index b23368d83..42528c719 100644 --- a/source/texk/web2c/luatexdir/font/dofont.c +++ b/source/texk/web2c/luatexdir/font/dofont.c @@ -81,12 +81,19 @@ static int do_define_font(int f, const char *cnom, scaled s, int natural_dir) set_skew_char(f, default_skew_char_par); } } - if (font_name(f) && strlen(font_name(f)) > 255) { + if (get_o_mode() == OMODE_DVI && + font_name(f) && strlen(font_name(f)) > 255) { /*tex The font name has to fit in the dvi file's single byte storage. There is no need to test area, as we are never using it. */ + const char *help[] = { + "Font name is too long to fit in DVI font name storage," + "it should be 255 characters at most.", + NULL + }; + tex_error("Too long font name", help); res = 0; } if (res) {