当前位置: 首页>>代码示例>>C++>>正文


C++ PSFont::Height方法代码示例

本文整理汇总了C++中PSFont::Height方法的典型用法代码示例。如果您正苦于以下问题:C++ PSFont::Height方法的具体用法?C++ PSFont::Height怎么用?C++ PSFont::Height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PSFont的用法示例。


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

示例1: Natural

void StrBrowserGraphic::Natural (int& w, int& h) {
    FullGraphic gs;
    totalGS(gs);
    PSFont* font = gs.GetFont();
    w = _width - _width % font->Width("n");
    h = _height - _height % font->Height();
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:7,代码来源:ibstrbrowser.c

示例2: RotatedIntersects

boolean TextGraphic::RotatedIntersects (BoxObj& userb, Graphic* gs) {
    int beg, end, lineSize, nextBeg, ypos = 0;
    const char* s = GetOriginal();
    int size = strlen(s);
    PSFont* f = gs->GetFont();
    Coord x[4], tx[5];
    Coord y[4], ty[5];
    
    x[0] = x[1] = x[2] = x[3] = y[0] = y[1] = 0;
    y[2] = y[3] = f->Height();

    for (beg = 0; beg < size; beg = nextBeg) {
        GetLine(s, size, beg, end, lineSize, nextBeg);
        x[1] = x[2] = f->Width(&s[beg], lineSize) - 1;
	transformList(x, y, 4, tx, ty, gs);
	tx[4] = tx[0];
	ty[4] = ty[0];
	FillPolygonObj fp(tx, ty, 5);
	if (fp.Intersects(userb)) {
            return true;
        }
        y[0] -= _lineHt;
        y[1] -= _lineHt;
        y[2] -= _lineHt;
        y[3] -= _lineHt;
    }
    return false;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:28,代码来源:text.c

示例3: intersects

boolean ULabel::intersects (BoxObj& userb, Graphic* gs) {
    Transformer* t = gs->GetTransformer();
    PSFont* f = gs->GetFont();
    Coord xmax = f->Width(_string);
    Coord ymax = f->Height();
    Coord tx0, ty0, tx1, ty1;
    
    if (t != nil && t->Rotated()) {
	Coord x[4], tx[5];
	Coord y[4], ty[5];
    
	x[0] = x[3] = y[0] = y[1] = 0;
	x[2] = x[1] = xmax;
	y[2] = y[3] = ymax;
	transformList(x, y, 4, tx, ty, gs);
	tx[4] = tx[0];
	ty[4] = ty[0];
	FillPolygonObj fp (tx, ty, 5);
	return fp.Intersects(userb);
    
    } else if (t != nil) {
	t->Transform(0, 0, tx0, ty0);
	t->Transform(xmax, ymax, tx1, ty1);
	BoxObj b1 (tx0, ty0, tx1, ty1);
	return b1.Intersects(userb);

    } else {
	BoxObj b2 (0, 0, xmax, ymax);
	return b2.Intersects(userb);
    }
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:31,代码来源:ulabel.cpp

示例4: contains

boolean ULabel::contains (PointObj& po, Graphic* gs) {
    PointObj pt (&po);
    PSFont* f = gs->GetFont();

    invTransform(pt._x, pt._y, gs);
    BoxObj b (0, 0, f->Width(_string), f->Height());
    return b.Contains(pt);
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:8,代码来源:ulabel.cpp

示例5: GetRowsCols

void StrBrowserGraphic::GetRowsCols (int& rows, int& cols) {
    FullGraphic gs;
    totalGS(gs);
    PSFont* font = gs.GetFont();

    rows = _height / font->Height();
    cols = _width / font->Width("n");

    rows = (rows == 0) ? 1 : rows;
    cols = (cols == 0) ? 1 : cols;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:11,代码来源:ibstrbrowser.c

示例6: Interpret

void TextComp::Interpret (Command* cmd) {
    TextGraphic* gr = (TextGraphic*) GetGraphic();

    if (cmd->IsA(BRUSH_CMD) || cmd->IsA(PATTERN_CMD)) {
        // do nothing

    } else if (cmd->IsA(FONT_CMD)) {
        PSFont* font = ((FontCmd*) cmd)->GetFont();
        cmd->Store(this, new VoidData(gr->GetFont()));
        gr->SetFont(font);
        gr->SetLineHeight(font->Height());      // hack; should be state var
        Notify();

    } else {
        GraphicComp::Interpret(cmd);
    }
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:17,代码来源:text.c

示例7: UntransformedIntersects

boolean TextGraphic::UntransformedIntersects (BoxObj& userb, Graphic* gs) {
    int beg, end, lineSize, nextBeg, ypos = 0;
    const char* s = GetOriginal();
    int size = strlen(s);
    PSFont* f = gs->GetFont();
    BoxObj box(0, 0, 0, f->Height());

    for (beg = 0; beg < size; beg = nextBeg) {
        GetLine(s, size, beg, end, lineSize, nextBeg);
        box._right = f->Width(&s[beg], lineSize) - 1;
        if (box.Intersects(userb)) {
            return true;
        }
        box._top -= _lineHt;
        box._bottom -= _lineHt;
    }
    return false;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:18,代码来源:text.c

示例8: getExtent

void ULabel::getExtent (
    float& x0, float& y0, float& cx, float& cy, float& tol, Graphic* gs
) {
    PSFont* f = gs->GetFont();
    float width = f->Width(_string);
    float height = f->Height();

    if (gs->GetTransformer() == nil) {
	x0 = 0;
	y0 = 0;
	cx = width / 2;
	cy = height / 2;
    } else {
        transformRect(0, 0, width, height, x0, y0, cx, cy, gs);
	cx = (cx + x0)/2;
	cy = (cy + y0)/2;
    }
    tol = 0;
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:19,代码来源:ulabel.cpp

示例9: contains

boolean TextGraphic::contains (PointObj& po, Graphic* gs) {
    PointObj pt (&po);
    PSFont* f = gs->GetFont();
    BoxObj box(0, 0, 0, f->Height());
    int beg, end, lineSize, nextBeg, ypos = 0;
    const char* s = GetOriginal();
    int size = strlen(s);

    invTransform(pt._x, pt._y, gs);
    
    for (beg = 0; beg < size; beg = nextBeg) {
        GetLine(s, size, beg, end, lineSize, nextBeg);
        box._right = f->Width(&s[beg], lineSize) - 1;
        if (box.Contains(pt)) {
            return true;
        }
        box._top -= _lineHt;
        box._bottom -= _lineHt;
    }
    return false;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:21,代码来源:text.c

示例10: TransformedIntersects

boolean TextGraphic::TransformedIntersects (BoxObj& userb, Graphic* gs) {
    int beg, end, lineSize, nextBeg, ypos = 0;
    const char* s = GetOriginal();
    int size = strlen(s);
    PSFont* f = gs->GetFont();
    Coord l, b, r, t = f->Height();
    Coord tl, tb, tr, tt;

    l = b = r = 0;
    
    for (beg = 0; beg < size; beg = nextBeg) {
        GetLine(s, size, beg, end, lineSize, nextBeg);
        r = f->Width(&s[beg], lineSize) - 1;
	transform(l, b, tl, tb, gs);
        transform(r, t, tr, tt, gs);
        BoxObj box(tl, tb, tr, tt);
	if (box.Intersects(userb)) {
            return true;
        }
        b -= _lineHt;
        t -= _lineHt;
    }
    return false;
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:24,代码来源:text.c


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