您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ FTPoint函数代码示例

51自学网 2021-06-01 20:43:52
  C++
这篇教程C++ FTPoint函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中FTPoint函数的典型用法代码示例。如果您正苦于以下问题:C++ FTPoint函数的具体用法?C++ FTPoint怎么用?C++ FTPoint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了FTPoint函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: fontSize

void                        OpenGLUI::_putTexts(IGame const &game){	int const		fontSize(_winSize.first / 19);	double const	padding(static_cast<double>(_winSize.first) / 19.);	double const	timeWidth(static_cast<double>(_winSize.first) / 19. * 8.);	double const	pausePadding(		(static_cast<double>(_winSize.first) -		 static_cast<double>(_winSize.first) / 19. * 4.) / 2.);	this->_font.FaceSize(fontSize);	this->_font.Render(		(std::string("Score: ") += std::to_string(game.getScore())).c_str(),		-1, FTPoint(padding, padding));	this->_font.Render(		(std::string("Played: ")		 += std::to_string(game.getPlayTime() / 60)		 += std::string(":")		 += std::string(game.getPlayTime() % 60 > 9 ? "" : "0")		 += std::to_string(game.getPlayTime() % 60)).c_str(),		-1, FTPoint(static_cast<double>(_winSize.first) - timeWidth - padding,					padding));	if (game.getSnake().isDie())	{		this->_font.Render(			std::string("Death!!").c_str(), -1,			FTPoint(pausePadding, static_cast<double>(_winSize.second) / 2.));			}	else if (game.isPaused())	{		this->_font.Render(			std::string("Paused").c_str(), -1,			FTPoint(pausePadding, static_cast<double>(_winSize.second) / 2.));	}	return ;}
开发者ID:Julow,项目名称:Nibbler,代码行数:35,


示例2: locker

	void Font::print(float x, float y, float z, const String& text)	{		if (text.empty())			return;		MutexLocker locker(pMutex);		if (!font)			return;		glScalef(1.0f, -1.0f, 1.0f);		for(int k = 0 ; k < (bBold ? 3 : 1) ; ++k)		{#ifdef __FTGL__lower__			font->Render( text.c_str(), -1,				FTPoint(x, -(y + 0.5f * (-font->Descender() + font->Ascender())), z),				FTPoint(), FTGL::RENDER_ALL);#else			glPushMatrix();			glTranslatef( x, -(y + 0.5f * (-font->Descender() + font->Ascender())), z );# ifndef TA3D_PLATFORM_DARWIN			WString wstr(text);			font->Render(wstr.cw_str());# else			font->Render(text.c_str());# endif			glPopMatrix();#endif		}		glScalef(1.0f, -1.0f, 1.0f);	}
开发者ID:joaocc,项目名称:ta3d-git,代码行数:29,


示例3: FTPoint

FTPoint FTFace::KernAdvance(unsigned int index1, unsigned int index2){    FTGL_DOUBLE x, y;    if(!hasKerningTable || !index1 || !index2)    {        return FTPoint(0.0, 0.0);    }    if(kerningCache && index1 < FTFace::MAX_PRECOMPUTED        && index2 < FTFace::MAX_PRECOMPUTED)    {        x = kerningCache[2 * (index2 * FTFace::MAX_PRECOMPUTED + index1)];        y = kerningCache[2 * (index2 * FTFace::MAX_PRECOMPUTED + index1) + 1];        return FTPoint(x, y);    }    FT_Vector kernAdvance;    kernAdvance.x = kernAdvance.y = 0;    err = FT_Get_Kerning(*ftFace, index1, index2, ft_kerning_unfitted,                         &kernAdvance);    if(err)    {        return FTPoint(0.0f, 0.0f);    }    x = static_cast<float>(kernAdvance.x) / 64.0f;    y = static_cast<float>(kernAdvance.y) / 64.0f;    return FTPoint(x, y);}
开发者ID:CombustibleLemonade,项目名称:AI,代码行数:32,


示例4: glPushMatrix

// 描画// text  表示文字列// pos   表示位置// color 表示色void Font::draw(const std::string& text, const Vec2f& pos, const Color& color) {  color.setToGl();  // OpenGLの行列スタックを利用  glPushMatrix();  font_->Render(text.c_str(), -1, FTPoint(pos.x(), pos.y()), FTPoint());  glPopMatrix();}
开发者ID:tek-nishi,项目名称:FFT-Sample,代码行数:12,


示例5: tex

FTGlyph::FTGlyph(FileStream & stream, char * data,                 int x_offset, int y_offset,                 int tex_width, int tex_height): tex(0){    charcode = stream.read_uint32();    float x1, y1, x2, y2;    x1 = stream.read_float();    y1 = stream.read_float();    x2 = stream.read_float();    y2 = stream.read_float();    bBox = FTBBox(x1, y1, x2, y2);    float advance_x, advance_y;    advance_x = stream.read_float();    advance_y = stream.read_float();    advance = FTPoint(advance_x, advance_y);    float corner_x, corner_y;    corner_x = stream.read_float();    corner_y = stream.read_float();    corner = FTPoint(corner_x, corner_y);    width = stream.read_int32();    height = stream.read_int32();    char * glyph = new char[width*height];    stream.read(glyph, width * height);    if (width && height) {        if (y_offset + height > tex_height) {            // copy subimage            height = tex_height - y_offset;        }        if (height >= 0) {            for (int y = 0; y < height; ++y) {                for (int x = 0; x < width; ++x) {                    char c = glyph[y * width + x];                    data[(y + y_offset) * tex_width + x + x_offset] = c;                }            }        }    }#ifdef USE_OUTLINE    uv[0].X(float(x_offset - 1) / float(tex_width));    uv[0].Y(float(y_offset - 1) / float(tex_height));    uv[1].X(float(x_offset + width + 1) / float(tex_width));    uv[1].Y(float(y_offset + height + 1) / float(tex_height));#else    uv[0].X(float(x_offset) / float(tex_width));    uv[0].Y(float(y_offset) / float(tex_height));    uv[1].X(float(x_offset + width) / float(tex_width));    uv[1].Y(float(y_offset + height) / float(tex_height));#endif    delete[] glyph;}
开发者ID:joaormatos,项目名称:anaconda,代码行数:55,


示例6: glGetFloatv

void FTExtrudeGlyphImpl::RenderSide(){    int contourFlag = vectoriser->ContourFlag();    //LOG_INFO("RenderSide %d", contourFlag);    GLfloat colors[4];    for(size_t c = 0; c < vectoriser->ContourCount(); ++c)    {        const FTContour* contour = vectoriser->Contour(c);        size_t n = contour->PointCount();        if(n < 2)        {            continue;        }        glGetFloatv(GL_CURRENT_COLOR, colors);        ftglBegin(GL_QUADS);        ftglColor4f(colors[0]/2, colors[1]/2, colors[2]/2, colors[3]/2);            for(size_t j = 0; j < n; j++ )            {                size_t cur = j % n;                size_t next = (j + 1) % n;                                FTPoint frontPt = contour->FrontPoint(cur);                FTPoint frontPt1 = contour->FrontPoint(next);                FTPoint backPt = contour->BackPoint(cur);                FTPoint backPt1 = contour->BackPoint(next);                FTPoint normal = FTPoint(0.f, 0.f, 1.f) ^ (frontPt - frontPt1);                if(normal != FTPoint(0.0f, 0.0f, 0.0f))                {                    const FTGL_DOUBLE* pD = static_cast<const FTGL_DOUBLE*>(normal.Normalise());                    glNormal3f( pD[0], pD[1], pD[2]);                }                ftglTexCoord2f(frontPt.Xf() / hscale, frontPt.Yf() / vscale);                if(contourFlag & ft_outline_reverse_fill)                {                    ftglVertex3f(backPt.Xf() / 64.0f, backPt.Yf() / 64.0f, 0.0f);                    ftglVertex3f(frontPt.Xf() / 64.0f, frontPt.Yf() / 64.0f, -depth);                    ftglVertex3f(frontPt1.Xf() / 64.0f, frontPt1.Yf() / 64.0f, -depth);                    ftglVertex3f(backPt1.Xf() / 64.0f, backPt1.Yf() / 64.0f, 0.0f);                }                else                {                    ftglVertex3f(backPt.Xf() / 64.0f, backPt.Yf() / 64.0f, -depth);                    ftglVertex3f(frontPt.Xf() / 64.0f, frontPt.Yf() / 64.0f, 0.0f);                    ftglVertex3f(frontPt1.Xf() / 64.0f, frontPt1.Yf() / 64.0f, 0.f);                    ftglVertex3f(backPt1.Xf() / 64.0f, backPt1.Yf() / 64.0f, -depth);                }            }        ftglEnd();    }}
开发者ID:JackFan-Z,项目名称:ftgles,代码行数:55,


示例7: textLife

void HudManager::renderPos(int X, int Y){  QString x,y;  x.setNum(X);  y.setNum(Y);  FTGLPixmapFont textLife("/home/dragmaf/Sviluppo/build-GraficaProgetto-Desktop-Debug/data/font/SuperMario256.ttf");  textLife.FaceSize(30);  textLife.Render("X",-1,FTPoint(70, height/2, 0));  textLife.Render(x.toStdString().c_str(),-1,FTPoint(120, height/2, 0));  textLife.Render("Y",-1,FTPoint(70, height/2-40, 0));  textLife.Render(y.toStdString().c_str(),-1,FTPoint(120, height/2-40, 0));}
开发者ID:Dragmaf93,项目名称:MarioMaze3d,代码行数:15,


示例8: glEnable

void HudManager::renderLose(){  glEnable(GL_LIGHT1);  FTGLPixmapFont lose("/home/dragmaf/Sviluppo/build-GraficaProgetto-Desktop-Debug/data/font/SuperMario256.ttf");  lose.FaceSize(72);  lose.Render("HAI PERSO",-1,FTPoint(width/2-200, height-190, 0));  lose.FaceSize(30);  lose.Render("Premi R per ricominciare a giocare.",-1,FTPoint(width/2-300, height/2-200, 0));  lose.Render("Premi ESC per chiudere.",-1,FTPoint(width/2-300, height/2-250, 0));  drawImage(textureLose,width/2-300,height/2-150,600,300);  glDisable(GL_LIGHT1);}
开发者ID:Dragmaf93,项目名称:MarioMaze3d,代码行数:15,


示例9: testGetPoint

        void testGetPoint()        {            FTTesselation tesselation(1);            CPPUNIT_ASSERT(tesselation.PointCount() == 0);            tesselation.AddPoint(10, 3, 0.7);            tesselation.AddPoint(-53, 2000, 23);            tesselation.AddPoint(77, -2.4, 765);            tesselation.AddPoint(117.5,  0.02, -99);            CPPUNIT_ASSERT(tesselation.PointCount() == 4);            CPPUNIT_ASSERT(tesselation.Point(2) == FTPoint(77, -2.4, 765));            CPPUNIT_ASSERT(tesselation.Point(20) != FTPoint(77, -2.4, 765));        }
开发者ID:BSVino,项目名称:ftgl-gl3,代码行数:15,


示例10: throw

void Font::renderText(const wchar_t* wText, float x, float y, float width, float height) throw(invalid_argument, runtime_error) {    ASSERT(        (wText != 0),        invalid_argument("wText")    );    std::lock_guard<std::mutex> guard(synchroMutex_);    if(font_ == 0) {        return;    }    size_t textLen = wcslen(wText);    if(width >= 0.0f) {        Font::FONT_RECT rect = measureText(wText);        if(rect.width > width) {            float pixPerChar     = rect.width / textLen;            float excess         = rect.width - width;            size_t charsForErase = static_cast<size_t>(lround(excess / pixPerChar));            textLen -= charsForErase;        }    }    glPushMatrix();    glPushAttrib(GL_COLOR_BUFFER_BIT);    glColor3fv(color_.c_array());    font_->Render(wText,                    textLen,                    FTPoint(static_cast<FTGL_FLOAT>(x), static_cast<FTGL_FLOAT>(y)),                    FTPoint(),                    FTGL::RENDER_ALL);    glPopAttrib();    glPopMatrix();}
开发者ID:ElijahVlasov,项目名称:EGF,代码行数:48,


示例11: FTPoint

void GUI::RenderPolyCount(){		//TODO: clean this up	stringstream ss1;	ss1 << "Quads: " << "10";	m_text->Render(ss1.str().c_str(), -1, FTPoint(m_width-200, m_height-115, 0));		stringstream ss2;	ss2 << "Tri: " << "20";	m_text->Render(ss2.str().c_str(), -1, FTPoint(m_width-200, m_height-130, 0));	stringstream ss3;	ss3 << "Vertices: " << "10";	m_text->Render(ss3.str().c_str(), -1, FTPoint(m_width-200, m_height-145, 0));}
开发者ID:SigtunaX,项目名称:procedural,代码行数:16,


示例12: WrapTextI

FTBBox FTSimpleLayout::BBox(const wchar_t *string, const int len){    FTBBox tmp;    int lines;    WrapTextI(string, len, FTPoint(), &tmp, lines);    return tmp;}
开发者ID:joaormatos,项目名称:anaconda,代码行数:7,


示例13: FTPoint

ofRectangle ofxFTGLFont::getStringBoundingBox(const wstring& s, float x, float y){    if(loaded){    	FTBBox bbox = font->BBox((wchar_t*)s.c_str(), -1, FTPoint(), trackingPoint);	    return ofRectangle(x + bbox.Lower().Xf(), y + bbox.Lower().Yf(), bbox.Upper().Xf(), bbox.Upper().Yf());    }	return ofRectangle();}
开发者ID:prisonerjohn,项目名称:ofxFTGL,代码行数:7,


示例14: ss

void Font::render(const vec3& pos, const std::string& text) const {    if (simpleLayout_) {        float delta = 0;        std::string line;        std::stringstream ss(text);        std::getline(ss, line);        FTPoint point(static_cast<double>(pos.x),                      static_cast<double>(pos.y),                      static_cast<double>(pos.z));        FTBBox box = font_->BBox(line.c_str(), -1, point);        delta -= box.Upper().Yf() - box.Lower().Yf(); // height of first line        Bounds bounds = getBounds(pos, text);        float height = bounds.getURB().y - bounds.getLLF().y;        switch(vAlign_) {            case Font::Top:                delta += height;                break;            case Font::Middle:                delta += height * 0.5f;                break;            case Font::Bottom:                break;        }        vec3 dpos = vec3(pos.x, pos.y + delta, pos.z);        glPushMatrix();        glRasterPos3f(dpos.x, dpos.y, dpos.z);        glTranslatef(dpos.x, dpos.y, dpos.z);        simpleLayout_->Render(text.c_str(), -1, FTPoint(dpos.x, dpos.y, dpos.z));        glPopMatrix();    }}
开发者ID:151706061,项目名称:Voreen,代码行数:33,


示例15: while

void FTFont::BBox( const wchar_t* string,                   float& llx, float& lly, float& llz, float& urx, float& ury, float& urz){    FTBBox totalBBox;    if((NULL != string) && ('/0' != *string))    {        const wchar_t* c = string;        float advance = 0;        if(CheckGlyph( *c))        {            totalBBox = glyphList->BBox( *c);            advance = glyphList->Advance( *c, *(c + 1));        }                while( *++c)        {            if(CheckGlyph( *c))            {                FTBBox tempBBox = glyphList->BBox( *c);                tempBBox.Move( FTPoint( advance, 0.0f, 0.0f));                totalBBox += tempBBox;                advance += glyphList->Advance( *c, *(c + 1));            }        }    }    llx = totalBBox.lowerX;    lly = totalBBox.lowerY;    llz = totalBBox.lowerZ;    urx = totalBBox.upperX;    ury = totalBBox.upperY;    urz = totalBBox.upperZ;}
开发者ID:Gi133,项目名称:NetworkingCoursework,代码行数:35,


示例16: CheckGlyph

void FTFont::BBox( const char* string,                   float& llx, float& lly, float& llz, float& urx, float& ury, float& urz){    FTBBox totalBBox;    if((NULL != string) && ('/0' != *string))    {        const unsigned char* c = (unsigned char*)string;        CheckGlyph( *c);        totalBBox = glyphList->BBox( *c);        float advance = glyphList->Advance( *c, *(c + 1));        ++c;                    while( *c)        {            CheckGlyph( *c);            FTBBox tempBBox = glyphList->BBox( *c);            tempBBox.Move( FTPoint( advance, 0.0f, 0.0f));            totalBBox += tempBBox;            advance += glyphList->Advance( *c, *(c + 1));            ++c;        }    }    llx = totalBBox.lowerX;    lly = totalBBox.lowerY;    llz = totalBBox.lowerZ;    urx = totalBBox.upperX;    ury = totalBBox.upperY;    urz = totalBBox.upperZ;}
开发者ID:CJFocke,项目名称:vsxu,代码行数:33,


示例17: TAssert

void CRenderingContext::RenderText(const tstring& sText, unsigned iLength, FTFont* pFont){	TAssert(m_pShader);	if (!m_pShader)		return;	CRenderContext& oContext = GetContext();	if (iLength == -1)		iLength = sText.length();	TAssert(m_pShader->m_iPositionAttribute >= 0);	TAssert(m_pShader->m_aiTexCoordAttributes[0] >= 0);	if (!oContext.m_bProjectionUpdated)		SetUniform("mProjection", oContext.m_mProjection);	if (!oContext.m_bViewUpdated)		SetUniform("mView", oContext.m_mView);	// Take the position out and let FTGL do it. It looks sharper that way.	Matrix4x4 mTransformations = oContext.m_mTransformations;	Vector vecPosition = mTransformations.GetTranslation();	mTransformations.SetTranslation(Vector());	SetUniform("mGlobal", mTransformations);	oContext.m_bProjectionUpdated = oContext.m_bViewUpdated = oContext.m_bTransformUpdated = true;	ftglSetAttributeLocations(m_pShader->m_iPositionAttribute, m_pShader->m_aiTexCoordAttributes[0]);	pFont->Render(sText.c_str(), iLength, FTPoint(vecPosition.x, vecPosition.y, vecPosition.z));}
开发者ID:BSVino,项目名称:CodenameInfinite,代码行数:32,


示例18: FTPoint

ofRectangle ofxFTGLFont::getStringBoundingBox(wstring s, float x, float y){    if(loaded){    	FTBBox bbox = font->BBox((wchar_t*)s.c_str(), -1, FTPoint(), trackingPoint);        return ofRectangle(x, y-getAscender(), abs(bbox.Lower().Xf()-bbox.Upper().Xf()), abs(bbox.Upper().Yf()-bbox.Lower().Yf()));    }	return ofRectangle();}
开发者ID:alangrizek,项目名称:ofxFTGL,代码行数:7,


示例19: err

FTGlyph::FTGlyph (FT_GlyphSlot glyph)	:   err(0) {	if (glyph) {		bBox = FTBBox (glyph);		advance = FTPoint (glyph->advance.x / 64.0f, glyph->advance.y / 64.0f, 0.0f);	}}
开发者ID:pseuudonym404,项目名称:tuxracer-touch,代码行数:7,


示例20: return

int DKFont::GetWidth(DKString text){	if(texture_font != NULL){		return (int)texture_font->Advance(text.c_str(),-1,FTPoint());	}	return 0;}
开发者ID:trigg4htre,项目名称:dklib,代码行数:7,


示例21: testPlusEquals

    void testPlusEquals() {        setUpFreetype();        FTBBox boundingBox1;        FTBBox boundingBox2( face->glyph);        boundingBox1 += boundingBox2;        CPPUNIT_ASSERT_DOUBLES_EQUAL(   2, boundingBox2.lowerX, 0.01);        CPPUNIT_ASSERT_DOUBLES_EQUAL( -15, boundingBox2.lowerY, 0.01);        CPPUNIT_ASSERT_DOUBLES_EQUAL(   0, boundingBox2.lowerZ, 0.01);        CPPUNIT_ASSERT_DOUBLES_EQUAL(  35, boundingBox2.upperX, 0.01);        CPPUNIT_ASSERT_DOUBLES_EQUAL(  38, boundingBox2.upperY, 0.01);        CPPUNIT_ASSERT_DOUBLES_EQUAL(   0, boundingBox2.upperZ, 0.01);        float advance  = 40;        boundingBox2.Move( FTPoint( advance, 0, 0));        boundingBox1 += boundingBox2;        CPPUNIT_ASSERT_DOUBLES_EQUAL(  42, boundingBox2.lowerX, 0.01);        CPPUNIT_ASSERT_DOUBLES_EQUAL( -15, boundingBox2.lowerY, 0.01);        CPPUNIT_ASSERT_DOUBLES_EQUAL(   0, boundingBox2.lowerZ, 0.01);        CPPUNIT_ASSERT_DOUBLES_EQUAL(  75, boundingBox2.upperX, 0.01);        CPPUNIT_ASSERT_DOUBLES_EQUAL(  38, boundingBox2.upperY, 0.01);        CPPUNIT_ASSERT_DOUBLES_EQUAL(   0, boundingBox2.upperZ, 0.01);        tearDownFreetype();    }
开发者ID:filenameexe,项目名称:scribble,代码行数:29,


示例22: width

FTBuffer::FTBuffer() : width(0),   height(0),   pixels(0),   pos(FTPoint()){}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:7,


示例23: glPushMatrix

void ofxFTGLFont::drawString(wstring s, float x, float y){    glPushMatrix();    glTranslatef(x, y, 0);    glScalef(1,-1,1);    font->Render((wchar_t*)s.c_str(), -1, FTPoint(), trackingPoint);    glPopMatrix();}
开发者ID:alangrizek,项目名称:ofxFTGL,代码行数:7,


示例24: Render

 const FTPoint& Render(const FTPoint& pen, int renderMode) {     FTGL_DOUBLE advancex, advancey;     renderCallback(baseGlyph, data, pen.X(), pen.Y(), renderMode,                    &advancex, &advancey);     advance = FTPoint(advancex, advancey);     return advance; }
开发者ID:Felipeasg,项目名称:workbench,代码行数:8,


示例25: glBegin

void FTExtrudeGlyphImpl::RenderSide(){    int contourFlag = vectoriser->ContourFlag();    for(size_t c = 0; c < vectoriser->ContourCount(); ++c)    {        const FTContour* contour = vectoriser->Contour(c);        size_t n = contour->PointCount();        if(n < 2)        {            continue;        }        glBegin(GL_QUAD_STRIP);            for(size_t j = 0; j <= n; ++j)            {                size_t cur = (j == n) ? 0 : j;                size_t next = (cur == n - 1) ? 0 : cur + 1;                const FTPoint& frontPt = contour->FrontPoint(cur);                const FTPoint& nextPt = contour->FrontPoint(next);                const FTPoint& backPt = contour->BackPoint(cur);                FTPoint normal = FTPoint(0.f, 0.f, 1.f) ^ (frontPt - nextPt);                if(normal != FTPoint(0.0f, 0.0f, 0.0f))                {                    glNormal3dv(static_cast<const FTGL_DOUBLE*>(normal.Normalise()));                }                glTexCoord2f(frontPt.Xf() / hscale, frontPt.Yf() / vscale);                if(contourFlag & ft_outline_reverse_fill)                {                    glVertex3f(backPt.Xf() / 64.0f, backPt.Yf() / 64.0f, 0.0f);                    glVertex3f(frontPt.Xf() / 64.0f, frontPt.Yf() / 64.0f, -depth);                }                else                {                    glVertex3f(backPt.Xf() / 64.0f, backPt.Yf() / 64.0f, -depth);                    glVertex3f(frontPt.Xf() / 64.0f, frontPt.Yf() / 64.0f, 0.0f);                }            }        glEnd();    }}
开发者ID:ethicalfive,项目名称:critterding,代码行数:46,


示例26: prevItr

inline void FTSimpleLayoutImpl::RenderSpaceI(const T *string, const int len,                                             FTPoint position, int renderMode,                                             const float extraSpace){    float space = 0.0;	    // If there is space to distribute, count the number of spaces    if(extraSpace > 0.0)    {        int numSpaces = 0;		        // Count the number of space blocks in the input        FTUnicodeStringItr<T> prevItr(string), itr(string);        for(int i = 0; ((len < 0) && *itr) || ((len >= 0) && (i <= len));            ++i, prevItr = itr++)        {            // If this is the end of a space block, increment the counter            if((i > 0) && !iswspace(*itr) && iswspace(*prevItr))            {                numSpaces++;            }        }		        space = extraSpace/numSpaces;    }		// Output all characters of the string    FTUnicodeStringItr<T> prevItr(string), itr(string);    for(int i = 0; ((len < 0) && *itr) || ((len >= 0) && (i <= len));        ++i, prevItr = itr++)    {        // If this is the end of a space block, distribute the extra space        // inside it        if((i > 0) && !iswspace(*itr) && iswspace(*prevItr))        {            pen += FTPoint(space, 0);        }				/**		 * We want to minimise repeated calls to this function -- is it possible to		 * set up a cache using Advance?		 */		pen = currentFont->Render(itr.getBufferFromHere(), 1, pen, FTPoint(), renderMode);    }}
开发者ID:xahgo,项目名称:tama,代码行数:45,


示例27: err

FTGlyphImpl::FTGlyphImpl(FT_GlyphSlot glyph, bool /*useList*/) : err(0){    if(glyph)    {        bBox = FTBBox(glyph);        advance = FTPoint(glyph->advance.x / 64.0f,                          glyph->advance.y / 64.0f);    }}
开发者ID:Felipeasg,项目名称:workbench,代码行数:9,


示例28: ofPushMatrix

void ofxFTGLFont::drawString(const wstring& s, float x, float y){	if(loaded){		ofPushMatrix();		ofTranslate(x, y, 0);		ofScale(1, -1, 1);		font->Render((wchar_t*)s.c_str(), -1, FTPoint(), trackingPoint);		ofPopMatrix();	}}
开发者ID:prisonerjohn,项目名称:ofxFTGL,代码行数:9,



注:本文中的FTPoint函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ FTRACE函数代码示例
C++ FTPException函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。