Rotated text?
Posted: 3 Dec 2008 17:39
Hello,
How can text be drawn at any particular angle?
Steve
How can text be drawn at any particular angle?
Steve
Visual Prolog Discussion forums
https://discuss.visual-prolog.com/
Code: Select all
typedef struct tagLOGFONT {
LONG lfHeight;
LONG lfWidth;
LONG lfEscapement;
LONG lfOrientation;
LONG lfWeight;
BYTE lfItalic;
BYTE lfUnderline;
BYTE lfStrikeOut;
BYTE lfCharSet;
BYTE lfOutPrecision;
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
TCHAR lfFaceName[LF_FACESIZE];
} LOGFONT, *PLOGFONT;
Code: Select all
FONT = vpi::fontCreate(ff_helvetica,List,FontSize),
binary::setIndexed_unsigned(Font,2,10*(Angle)),
binary::setIndexed_unsigned(Font,3,10*(Angle)),
.......
Code: Select all
predicates
onTestTextOrientation : window::menuItemListener.
clauses
onTestTextOrientation(Task, _MenuTag) :-
tiled:=tile::new1(Task),
_=[
TestWindow
||
std::fromToInStep(0,420,60)=Escapement,
%std::fromToInStep(0,300,60)=Orientation,
Orientation=0,
Title=string::format("Escapement= %3d, orientation = %3d",Escapement,Orientation),
TestWindow=vpi::winCreate(w_TopLevel,rct(0,0,240,240),Title,noMenu,getTaskWindow(),
plainFigure::plain_flags,
testOrientationHandler,gui_api::mkL(1000*Escapement+Orientation)),
asserta(drawmode_window(TestWindow))
].
predicates
testOrientationHandler:eHandler.
clauses
testOrientationHandler(_, e_Create(_)) = gui_api::rNull /* uncheckedConvert(gui_Native::lResult,0) */ :-
_Fit=taskWindow::tiled:move(applicationWindow::get()),
!.
% Mkr used as recommended in upgrade notes
testOrientationHandler(H, e_Update(_Update_Rect)) = gui_api::mkR(3) :-
D=gui_api::getUnsigned(winGetData(H)),
Escapement=D div 1000,
Orientation=D mod 100,
paintObliqueText(H,winGetClientRect(H),winGetText(H),Escapement,Orientation),
!.
testOrientationHandler(H,e_CloseRequest())=gui_api::rNull :-
retractall(drawmode_window(H)),
winDestroy(H),
!.
testOrientationHandler(_Handler, _Event) = gui_api::rNull.