⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 font.c

📁 这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易于我们学习和理解
💻 C
字号:
#include	<u.h>#include	<libc.h>#include	<libg.h>#include	<bio.h>#include	"hdr.h"Subfont *bf(int n, int size, Bitmap *b, int *done){	Fontchar *fc;	int i, j;	Subfont *f;	fc = (Fontchar *)malloc(sizeof(Fontchar)*(n+1));	if(fc == 0){		fprint(2, "%s: fontchar malloc(%d) failure\n", argv0, sizeof(Fontchar)*(n+1));		exits("fontchar malloc failure");	}	j = 0;	for(i = 0; i <= n; i++){		fc[i] = (Fontchar){j, 0, size, 0, size};		if(done[i])			j += size;		else			fc[i].width = 0;	}	fc[n] = (Fontchar){j, 0, size, 0, size};	f = subfalloc(n, size, size*7/8, fc, b, ~0, ~0);	if(f == 0){		fprint(2, "%s: falloc failure\n", argv0);		exits("falloc failure");	}	return(f);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -