예제 #1
0
void BLF_clipping(int fontid, float xmin, float ymin, float xmax, float ymax)
{
	FontBLF *font = BLF_get(fontid);

	if (font) {
		font->clip_rec.xmin = xmin;
		font->clip_rec.ymin = ymin;
		font->clip_rec.xmax = xmax;
		font->clip_rec.ymax = ymax;
	}
}
예제 #2
0
void BLF_clipping_default(float xmin, float ymin, float xmax, float ymax)
{
	FontBLF *font = BLF_get(global_font_default);

	if (font) {
		font->clip_rec.xmin = xmin;
		font->clip_rec.ymin = ymin;
		font->clip_rec.xmax = xmax;
		font->clip_rec.ymax = ymax;
	}
}
예제 #3
0
void BLF_draw_ascii(int fontid, const char *str, size_t len)
{
	FontBLF *font = BLF_get(fontid);
	GLint mode, param;

	if (font && font->glyph_cache) {
		blf_draw__start(font, &mode, &param);
		blf_font_draw_ascii(font, str, len);
		blf_draw__end(mode, param);
	}
}
예제 #4
0
float BLF_ascender(int fontid)
{
	FontBLF *font;

	font= BLF_get(fontid);
	if (font) {
		if(font->glyph_cache)
			return(font->glyph_cache->ascender);
	}
	return(0.0f);
}
예제 #5
0
float BLF_width_max(int fontid)
{
	FontBLF *font;

	font= BLF_get(fontid);
	if (font) {
		if(font->glyph_cache)
			return(font->glyph_cache->max_glyph_width);
	}
	return(0.0f);
}
예제 #6
0
void BLF_matrix(int fontid, double *m)
{
	FontBLF *font;
	int i;

	font= BLF_get(fontid);
	if (font) {
		for (i= 0; i < 16; i++)
			font->m[i]= m[i];
	}
}
예제 #7
0
void BLF_aspect(int fontid, float x, float y, float z)
{
	FontBLF *font;

	font= BLF_get(fontid);
	if (font) {
		font->aspect[0]= x;
		font->aspect[1]= y;
		font->aspect[2]= z;
	}
}
예제 #8
0
파일: blf.c 프로젝트: OldBrunet/BGERTPS
void BLF_buffer_col(int fontid, float r, float g, float b, float a)
{
	FontBLF *font;

	font= BLF_get(fontid);
	if (font) {
		font->b_col[0]= r;
		font->b_col[1]= g;
		font->b_col[2]= b;
		font->b_col[3]= a;
	}
}
예제 #9
0
void BLF_buffer(int fontid, float *fbuf, unsigned char *cbuf, int w, int h, int nch)
{
	FontBLF *font = BLF_get(fontid);

	if (font) {
		font->b_fbuf = fbuf;
		font->b_cbuf = cbuf;
		font->bw = w;
		font->bh = h;
		font->bch = nch;
	}
}
예제 #10
0
void BLF_shadow(int fontid, int level, float r, float g, float b, float a)
{
	FontBLF *font = BLF_get(fontid);

	if (font) {
		font->shadow = level;
		font->shadow_col[0] = r;
		font->shadow_col[1] = g;
		font->shadow_col[2] = b;
		font->shadow_col[3] = a;
	}
}
예제 #11
0
파일: blf.c 프로젝트: OldBrunet/BGERTPS
void BLF_position(int fontid, float x, float y, float z)
{
	FontBLF *font;
	float remainder;
	float xa, ya, za;

	font= BLF_get(fontid);
	if (font) {
		if (font->flags & BLF_ASPECT) {
			xa= font->aspect[0];
			ya= font->aspect[1];
			za= font->aspect[2];
		}
		else {
			xa= 1.0f;
			ya= 1.0f;
			za= 1.0f;
		}

		remainder= x - floor(x);
		if (remainder > 0.4 && remainder < 0.6) {
			if (remainder < 0.5)
				x -= 0.1 * xa;
			else
				x += 0.1 * xa;
		}

		remainder= y - floor(y);
		if (remainder > 0.4 && remainder < 0.6) {
			if (remainder < 0.5)
				y -= 0.1 * ya;
			else
				y += 0.1 * ya;
		}

		remainder= z - floor(z);
		if (remainder > 0.4 && remainder < 0.6) {
			if (remainder < 0.5)
				z -= 0.1 * za;
			else
				z += 0.1 * za;
		}

		font->pos[0]= x;
		font->pos[1]= y;
		font->pos[2]= z;
	}
}