Bug 199438

Summary: vt(4) cannot load GNU Unifont
Product: Base System Reporter: Ting-Wei Lan <lantw44>
Component: kernAssignee: Ed Maste <emaste>
Status: Closed FIXED    
Severity: Affects Only Me CC: emaste
Priority: --- Keywords: patch, vt
Version: 10.1-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Increase VTFONT_MAXMAPPINGS and VTFONT_MAXGLYPHSIZE none

Description Ting-Wei Lan 2015-04-14 03:15:49 UTC
Created attachment 155584 [details]
Increase VTFONT_MAXMAPPINGS and VTFONT_MAXGLYPHSIZE

I downloaded GNU Unifont from this website: http://www.unifoundry.com/unifont.html

I tried to convert the BDF file to FNT file with vtfontcvt, but I got E2BIG error when trying to load the converted file with vidcontrol -f.

It seems it was caused by the limits set in sys/dev/vt/vt_font.c.
#define    VTFONT_MAXMAPPINGS  8192         
#define    VTFONT_MAXGLYPHSIZE 1048576      

The values showed when loading the font.
f->map_count[0] = 12894
f->map_count[1] = 23362
f->map_count[2] = 0
f->map_count[3] = 0
glyphsize = 1133296

If I increase the limit with the attached patch, the font can be successfully loaded.
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-04-14 19:19:04 UTC
A commit references this bug:

Author: emaste
Date: Tue Apr 14 19:18:34 UTC 2015
New revision: 281537
URL: https://svnweb.freebsd.org/changeset/base/281537

Log:
  Increase vt font limits to allow use of GNU Unifont

  PR:		199438
  Submitted by:	Ting-Wei Lan <lantw44@gmail.com>
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/sys/dev/vt/vt_font.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-04-24 15:32:29 UTC
A commit references this bug:

Author: emaste
Date: Fri Apr 24 15:32:13 UTC 2015
New revision: 281933
URL: https://svnweb.freebsd.org/changeset/base/281933

Log:
  MFC r281537: Increase vt font limits to allow use of GNU Unifont

  PR:		199438
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/10/
  stable/10/sys/dev/vt/vt_font.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-04-24 15:34:30 UTC
A commit references this bug:

Author: emaste
Date: Fri Apr 24 15:34:20 UTC 2015
New revision: 281934
URL: https://svnweb.freebsd.org/changeset/base/281934

Log:
  MFC r281537: Increase vt font limits to allow use of GNU Unifont

  PR:		199438
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/9/sys/
_U  stable/9/sys/dev/
  stable/9/sys/dev/vt/vt_font.c
Comment 4 Ed Maste freebsd_committer freebsd_triage 2015-04-24 15:38:29 UTC
Committed to HEAD, stable/10 and stable/9. The fix will be available in FreeBSD 11.0 and 10.2.

Thanks for reporting and for the patch!