Page 1 of 1

Rotated text?

Posted: 3 Dec 2008 17:39
by Steve Lympany
Hello,
How can text be drawn at any particular angle?
Steve

Posted: 4 Dec 2008 22:22
by Chan Bok
The LOGFONT structure has a lfOrientation field:

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;

Chan Bok
Axon Research

Posted: 5 Dec 2008 0:48
by Kari Rastas
Addition to Chan Bok's advice

Code: Select all

        FONT = vpi::fontCreate(ff_helvetica,List,FontSize),         binary::setIndexed_unsigned(Font,2,10*(Angle)),         binary::setIndexed_unsigned(Font,3,10*(Angle)),         .......

Posted: 5 Dec 2008 1:58
by Chan Bok
Yes, it is the Escapement that determines the rotation.
The Orientation can be set to 0.

Posted: 5 Dec 2008 10:01
by Steve Lympany
Hi,
Very good, thanks.
I think it would be good to put this in the wiki...
cheers
Steve

What does Orientation do in the logFont structure?

Posted: 30 Dec 2014 13:38
by Ferenc Nagy
OK, I have commented out the stepping with the Orientation variable.
The results were good only by changing the Escapement.
What is the role of the Orientation? Can you give me an example where its value has effect on the drawn text?

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.

Posted: 30 Dec 2014 15:16
by Thomas Linder Puls
From the description (LOGFONT structure) it seems that:
  • Orientation is for each character, i.e. without changing the "escapement" (which is apparently the direction in which the entire text line points).
  • If the graphics mode is GM_COMPATIBLE only the escapement have any effect.
It must be some other predicate/function that changes the graphics mode.

GM_COMPATIBLE and GM_ADVANCED

Posted: 4 Jan 2015 16:10
by Ferenc Nagy
Hi,
SetGraphicsMode function:
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
What is GM_COMPATIBLE and GM_ADVANCED?
How can I set them from VIP?
What are their main differences?