Lines Matching refs:vf
87 vtfont_lookup(const struct vt_font *vf, term_char_t c)
105 dst = vtfont_bisearch(vf->vf_map[bold_map],
106 vf->vf_map_count[bold_map], src);
110 dst = vtfont_bisearch(vf->vf_map[normal_map],
111 vf->vf_map_count[normal_map], src);
114 stride = howmany(vf->vf_width, 8) * vf->vf_height;
115 return (&vf->vf_bytes[dst * stride]);
119 vtfont_ref(struct vt_font *vf)
122 refcount_acquire(&vf->vf_refcount);
123 return (vf);
127 vtfont_unref(struct vt_font *vf)
131 if (refcount_release(&vf->vf_refcount)) {
133 free(vf->vf_map[i], M_VTFONT);
134 free(vf->vf_bytes, M_VTFONT);
135 free(vf, M_VTFONT);
165 struct vt_font *vf;
190 vf = malloc(sizeof *vf, M_VTFONT, M_WAITOK | M_ZERO);
191 vf->vf_bytes = malloc(glyphsize, M_VTFONT, M_WAITOK);
192 vf->vf_height = f->height;
193 vf->vf_width = f->width;
194 vf->vf_refcount = 1;
198 vf->vf_map_count[i] = f->map_count[i];
202 vf->vf_map[i] = malloc(mapsize, M_VTFONT, M_WAITOK);
203 error = copyin(f->map[i], vf->vf_map[i], mapsize);
206 error = vtfont_validate_map(vf->vf_map[i], vf->vf_map_count[i],
213 error = copyin(f->glyphs, vf->vf_bytes, glyphsize);
218 *ret = vf;
221 bad: vtfont_unref(vf);