void DrawTextFont(cdCanvas* canvas, const char* font, int size, int xoff, int yoff, char* text) { cdCanvasFont(canvas, font, CD_PLAIN, size); DrawTextBox(canvas, xoff, yoff, text); cdCanvasFont(canvas, font, CD_BOLD, size); DrawTextBox(canvas, 2*xoff, yoff, text); cdCanvasFont(canvas, font, CD_ITALIC, size); DrawTextBox(canvas, 3*xoff, yoff, text); cdCanvasFont(canvas, font, CD_BOLD_ITALIC, size); DrawTextBox(canvas, 4*xoff, yoff, text); }
//***************************************************************************** // // Draws centered text within a rectangle and annotates with left/right or // up/down arrows. // // \param pszText is a pointer to the zero-terminated ASCII string which will // be displayed within the given rectangle. // \param prectOutline is a pointer to a rectangle defining the area of the // control which is to be drawn. // \param bLeftRight is \b true if left and right arrow annotations are to // be drawn or \b false for up and down arrows. // \param psColors points to a structure defining the colors to be used for // the background, outline and text. // // This function is a combination of DrawTextBox() and DrawDirectionMarkers() // and is used to display controls on the screen. It fills the given rectangle // with a background color, outlines it, renders the supplied text string in // the center of the rectangle then annotates the rectangle with direction // markers. // // If \e bLeftRight is \b true, a small arrow pointing left is drawn on the // left side of the rectangle, indented by 2 pixels to avoid the outline // rectangle. A similar, right pointing arrow is drawn on the right side of // the rectangle. If \e bLeftRight is \b false, small up and down pointing // arrows are drawn on the left side of the rectangle. // // \return None. // //***************************************************************************** void DrawTextBoxWithMarkers(const char *pszText, tRectangle *prectOutline, tOutlineTextColors *psColors, tBoolean bLeftRight) { DrawTextBox(pszText, prectOutline, psColors); DrawDirectionMarkers(prectOutline, bLeftRight, psColors->ulBorder); }
void OptionSelectionMenu::renderShortcutChangeMessage(RenderDevice* prender) { if (ovr_GetTimeInSeconds() < PopupMessageTimeout) { DrawTextBox(prender, 0, 120, 22.0f, PopupMessage.ToCStr(), DrawText_Center | (PopupMessageBorder ? DrawText_Border : 0)); } }
void cMenu::DrawMenu() { //Body Stuff. GradientRect(10, 10, 300, 20, Grey, DGrey); DrawFilledRectangle(10,30,300,280,DGrey); DrawNonFilledRectangle(10,10,300,300,Outline); PrintText("Mentranium", 100,20,White,Font.g_pFont); //Tabs. sizeoftab = 291 / (TabCount); DrawNonFilledRectangle(15,61, sizeoftab * TabCount, 243,Outline); for (int i = 0; i < TabCount; i++) { DrawTab(i, 15 + (i*sizeoftab), 41,sizeoftab); } //Checks. int d = 0; for(int i = 0; i < CheckCount; i++) { if(ActiveName == Checks[i].Parent) { DrawCheckBox(i,30, 70 + (d*20)); d++; } } //Sliders. d = 0; for(int i = 0; i < SliderCount; i++) { if(ActiveName == Sliders[i].Parent) { DrawSlider(i,150, 100 + (d*40)); d++; } } //Text Boxes. d = 0; for(int i = 0; i < TextBoxCount; i++) { if(ActiveName == TextBoxes[i].Parent) { DrawTextBox(i,150, 100 + (d*40)); d++; } } }
static long ChooseTauntSetup( ScreenParams *params ) { ChooseTauntGlobals *choose; KeyboardEntryLayout *keyLayout; segaCharRect tbRect; Point boxLocation; Rect boxRect; DisableDefDialogs(); choose = (ChooseTauntGlobals *)NewMemory( kTemp, sizeof(ChooseTauntGlobals) ); EraseGDevice ( kScrollA ); SetBackdropID ( kBlackBackground, true, 0 ); GetScreenLayoutPoint( kChooseTauntScreen, kTauntEntryBoxLocation, &boxLocation ); choose->typingBox = DrawDBGraphicAt( 0, kTauntEntryField, boxLocation.h>>3, boxLocation.v>>3, kScrollB ); SetCurrentDevice( kScrollA ); SetCurFont( kXBandHeavy ); SetFontColors( 0, 11, 10, 0 ); choose->titlePatterns = DrawScreenLayoutString( kChooseTauntScreen, kTauntHeadlineString ); SetCurFont( kXBandLight9Font ); SetFontColors( 0, 9, 8, 0 ); choose->descriptionPatterns = BoxScreenLayoutString( kChooseTauntScreen, kTauntDescriptionString, kTauntDescriptionRect, kJustLeft ); GetScreenLayoutCharRect( kChooseTauntScreen, kTauntJizzleRect, &tbRect ); choose->tbRef = DrawTextBox( &tbRect, kGreenColor, kScrollA ); StartTextBoxAnimation( choose->tbRef, 10 ); keyLayout = SetupKeyboardEntryLayout( kChooseTauntKeyboardEntry ); choose->keyRef = InitKeyboardEntry( keyLayout, 0 ); choose->keyLayout = keyLayout; SetKeyboardEntryMeasureProc( choose->keyRef, TauntMeasureProc ); /* Place the existing taunt in the entry field */ { char *existingTaunt; existingTaunt = (char *)GetPersonificationPart( GetCurrentLocalUser()->userID, kPersonificationTauntText ); StuffCurrentKeyboardField( choose->keyRef, existingTaunt ); } return (long) choose; }
//***************************************************************************** // // Draw a single button in the menu using the supplied colors. // //***************************************************************************** static void MenuDrawGroupButton(tMenu *psMenu, unsigned char ucIndex, tOutlineTextColors *psColors) { tRectangle rectBtn; // // Determine the bounds of this button. // rectBtn.sXMin = MENU_BTN_X; rectBtn.sXMax = MENU_BTN_X + MENU_BTN_WIDTH - 1; rectBtn.sYMin = MENU_BTN_Y(ucIndex); rectBtn.sYMax = MENU_BTN_Y(ucIndex) + MENU_BTN_HEIGHT - 1; DrawTextBox((char *)(psMenu->ppcGroups[ucIndex]->pcName), &rectBtn, psColors); }
static long ChoosePasswordSetup( ScreenParams *params ) { ChoosePasswordGlobals *choose; Point boxLocation; segaCharRect tbRect; choose = (ChoosePasswordGlobals *)NewMemory( kTemp, sizeof(ChoosePasswordGlobals)); choose->addPWChar = (ChoosePasswordProc) _AddPWChar; choose->doubleCheckAndSetPassword = (ChoosePasswordProc) _DoubleCheckAndSetPassword; choose->resetEnteredPassword = (ChoosePasswordProc) _ResetEnteredPassword; choose->setupPWChar = (ChoosePasswordProc) _SetupPWChar; choose->charSprite = 0; // zero allocations choose->textState = 0; EraseGDevice ( kScrollA ); SetBackdropID ( kBlackBackground, true, 0 ); SetCurrentDevice( kScrollA ); GetScreenLayoutPoint( kChoosePasswordScreen, kLayoutBoxPoint, &boxLocation ); choose->boxGraphic = DrawDBGraphicAt( 0, kPasswordBox, boxLocation.h>>3, boxLocation.v>>3, kScrollA ); SetCurrentDevice( kScrollA ); SetCurFont( kXBandHeavy ); SetFontColors( 0, 11, 10, 0 ); choose->titlePatterns = DrawScreenLayoutString( kChoosePasswordScreen, kLayoutTitleString ); SetCurFont( kXBandLight9Font ); SetFontColors( 0, 9, 8, 0 ); choose->descriptionPatterns = BoxScreenLayoutString( kChoosePasswordScreen, kLayoutDescriptionString, kLayoutDescriptionRect, kJustLeft ); SetFontColors( 0, kDarkPurpleColor, kPurpleColor, 0 ); choose->donePatterns = DrawScreenLayoutString( kChoosePasswordScreen, kLayoutDoneString ); GetScreenLayoutCharRect( kChoosePasswordScreen, kLayoutJizzleRect, &tbRect ); choose->jizzleRef = DrawTextBox( &tbRect, kGreenColor, kScrollA ); StartTextBoxAnimation( choose->jizzleRef, 10 ); SetupPWChar( choose ); return (long) choose; }
tBoolean TriggerAcquireControlProc(tControl *psControl, tEvent eEvent) { switch(eEvent) { case MENU_EVENT_ACTIVATE: { DrawTextBoxWithMarkers(psControl->pcName, &rectCtrlName, &g_sControlColors, false); // // If we are capturing continuously... // if(g_bContinuousCapture) { // // ...then single shot capture is not available. // DrawTextBox("N/A", &rectCtrlValue, &g_sControlColors); } else { // // ...otherwise it is. // DrawTextBoxWithMarkers("Capture...", &rectCtrlValue, &g_sControlColors, true); } // // No waveform area redraw is required. // return(false); } // // We trigger a one-shot capture on the button release event rather // than the button press. This is to ensure that any bouncing that // goes on will not trigger the abort mechanism used to get out of // locked-up captures (where the trigger is set to some level that // never occurs in the signal). // case MENU_EVENT_LEFT_RELEASE: case MENU_EVENT_RIGHT_RELEASE: { // // If we are not capturing continuously... // if(!g_bContinuousCapture) { // // Tell the main loop to arm for a single-shot capture. // COMMAND_FLAG_WRITE(SCOPE_CAPTURE, 0); } break; } // // We ignore other events and tell the caller that no refresh of the // waveform display is required. // default: { break; } } return(false); }
void OculusWorldDemoApp::RenderEyeView(ovrEyeType eye) { Recti renderViewport = EyeTexture[eye].Header.RenderViewport; Matrix4f viewAdjust = Matrix4f::Translation(Vector3f(EyeRenderDesc[eye].ViewAdjust)); // *** 3D - Configures Viewport/Projection and Render pRender->ApplyStereoParams(renderViewport, Projection[eye]); pRender->SetDepthMode(true, true); Matrix4f baseTranslate = Matrix4f::Translation(ThePlayer.BodyPos); Matrix4f baseYaw = Matrix4f::RotationY(ThePlayer.BodyYaw.Get()); if (GridDisplayMode != GridDisplay_GridOnly) { if (SceneMode != Scene_OculusCubes) { MainScene.Render(pRender, viewAdjust * View); RenderAnimatedBlocks(eye, ovr_GetTimeInSeconds()); } if (SceneMode == Scene_Cubes) { // Draw scene cubes overlay. Red if position tracked, blue otherwise. Scene sceneCubes = (HmdStatus & ovrStatus_PositionTracked) ? RedCubesScene : BlueCubesScene; sceneCubes.Render(pRender, viewAdjust * View * baseTranslate * baseYaw); } else if (SceneMode == Scene_OculusCubes) { OculusCubesScene.Render(pRender, viewAdjust * View * baseTranslate * baseYaw); } } if (GridDisplayMode != GridDisplay_None) { RenderGrid(eye); } // *** 2D Text - Configure Orthographic rendering. // Render UI in 2D orthographic coordinate system that maps [-1,1] range // to a readable FOV area centered at your eye and properly adjusted. pRender->ApplyStereoParams(renderViewport, OrthoProjection[eye]); pRender->SetDepthMode(false, false); // We set this scale up in CreateOrthoSubProjection(). float textHeight = 22.0f; // Display Loading screen-shot in frame 0. if (LoadingState != LoadingState_Finished) { const float scale = textHeight * 25.0f; Matrix4f view ( scale, 0.0f, 0.0f, 0.0f, scale, 0.0f, 0.0f, 0.0f, scale ); LoadingScene.Render(pRender, view); String loadMessage = String("Loading ") + MainFilePath; DrawTextBox(pRender, 0.0f, -textHeight, textHeight, loadMessage.ToCStr(), DrawText_HCenter); LoadingState = LoadingState_DoLoad; } // HUD overlay brought up by spacebar. RenderTextInfoHud(textHeight); // Menu brought up by Menu.Render(pRender); }
void OculusWorldDemoApp::RenderTextInfoHud(float textHeight) { // View port & 2D ortho projection must be set before call. float hmdYaw, hmdPitch, hmdRoll; switch(TextScreen) { case Text_Info: { char buf[512], gpustat[256]; // Average FOVs. FovPort leftFov = EyeRenderDesc[0].Fov; FovPort rightFov = EyeRenderDesc[1].Fov; // Rendered size changes based on selected options & dynamic rendering. int pixelSizeWidth = EyeTexture[0].Header.RenderViewport.Size.w + ((!ForceZeroIpd) ? EyeTexture[1].Header.RenderViewport.Size.w : 0); int pixelSizeHeight = ( EyeTexture[0].Header.RenderViewport.Size.h + EyeTexture[1].Header.RenderViewport.Size.h ) / 2; // No DK2, no message. char latency2Text[128] = ""; { //float latency2 = ovrHmd_GetMeasuredLatencyTest2(Hmd) * 1000.0f; // show it in ms //if (latency2 > 0) // OVR_sprintf(latency2Text, sizeof(latency2Text), "%.2fms", latency2); float latencies[3] = { 0.0f, 0.0f, 0.0f }; if (ovrHmd_GetFloatArray(Hmd, "DK2Latency", latencies, 3) == 3) { char latencyText0[32], latencyText1[32], latencyText2[32]; FormatLatencyReading(latencyText0, sizeof(latencyText0), latencies[0]); FormatLatencyReading(latencyText1, sizeof(latencyText1), latencies[1]); FormatLatencyReading(latencyText2, sizeof(latencyText2), latencies[2]); OVR_sprintf(latency2Text, sizeof(latency2Text), " DK2 Latency Ren: %s TWrp: %s\n" " PostPresent: %s ", latencyText0, latencyText1, latencyText2); } } ThePlayer.HeadPose.Rotation.GetEulerAngles<Axis_Y, Axis_X, Axis_Z>(&hmdYaw, &hmdPitch, &hmdRoll); OVR_sprintf(buf, sizeof(buf), " HMD YPR:%4.0f %4.0f %4.0f Player Yaw: %4.0f\n" " FPS: %.1f ms/frame: %.1f Frame: %d\n" " Pos: %3.2f, %3.2f, %3.2f HMD: %s\n" " EyeHeight: %3.2f, IPD: %3.1fmm\n" //", Lens: %s\n" " FOV %3.1fx%3.1f, Resolution: %ix%i\n" "%s", RadToDegree(hmdYaw), RadToDegree(hmdPitch), RadToDegree(hmdRoll), RadToDegree(ThePlayer.BodyYaw.Get()), FPS, SecondsPerFrame * 1000.0f, FrameCounter, ThePlayer.BodyPos.x, ThePlayer.BodyPos.y, ThePlayer.BodyPos.z, //GetDebugNameHmdType ( TheHmdRenderInfo.HmdType ), HmdDesc.ProductName, ThePlayer.UserEyeHeight, ovrHmd_GetFloat(Hmd, OVR_KEY_IPD, 0) * 1000.0f, //( EyeOffsetFromNoseLeft + EyeOffsetFromNoseRight ) * 1000.0f, //GetDebugNameEyeCupType ( TheHmdRenderInfo.EyeCups ), // Lens/EyeCup not exposed (leftFov.GetHorizontalFovDegrees() + rightFov.GetHorizontalFovDegrees()) * 0.5f, (leftFov.GetVerticalFovDegrees() + rightFov.GetVerticalFovDegrees()) * 0.5f, pixelSizeWidth, pixelSizeHeight, latency2Text ); size_t texMemInMB = pRender->GetTotalTextureMemoryUsage() / 1058576; if (texMemInMB) { OVR_sprintf(gpustat, sizeof(gpustat), " GPU Tex: %u MB", texMemInMB); OVR_strcat(buf, sizeof(buf), gpustat); } DrawTextBox(pRender, 0.0f, 0.0f, textHeight, buf, DrawText_Center); } break; case Text_Timing: Profiler.DrawOverlay(pRender); break; case Text_Help1: DrawTextBox(pRender, 0.0f, 0.0f, textHeight, HelpText1, DrawText_Center); break; case Text_Help2: DrawTextBox(pRender, 0.0f, 0.0f, textHeight, HelpText2, DrawText_Center); break; case Text_None: break; default: OVR_ASSERT ( !"Missing text screen" ); break; } }
long XSetupSetup( ScreenParams *params ) { XSetupGlobals *setup; Point *xPosition; segaCharRect jizzleRect; char *phoneString; phoneNumber *local1, *local2; setup = (XSetupGlobals *)NewMemory( kTemp, sizeof(XSetupGlobals) ); EraseGDevice ( kScrollA ); SetBackdropID ( kBlackBackground, true, 0 ); SetCurrentDevice( kScrollA ); SetCurFont( kXBandHeavy ); SetFontColors( 0, kDarkYellowColor, kYellowColor, 0 ); setup->titlePatterns = DrawScreenLayoutString( kXBandSetupScreen, kSetupTitleString ); setup->bgGraphic = DrawDBGraphicAt( 0, kSettingsIcon, 29, 2, kScrollA ); setup->lineGraphic = DrawDBGraphicAt( 0, kGrayHorizontalLine, 5, 18, kScrollA ); GetScreenLayoutCharRect( kXBandSetupScreen, 0, &jizzleRect ); setup->jizzle = DrawTextBox( &jizzleRect, 8, kScrollA ); StartTextBoxAnimation( setup->jizzle, 10 ); GetScreenLayoutCharRect( kXBandSetupScreen, kSetupDescriptionRect, &setup->descriptionRect ); setup->descriptionPatterns = LinearizeScreenArea( &setup->descriptionRect, 0 ); // Accept Challenges: setup->radioRefs[kAcceptChallengesButton] = SetupRadioButton( kAcceptChallengesButton+1, phoneString ); RadioButtonSetSelection(setup->radioRefs[kAcceptChallengesButton], GetAcceptChallengesOption( GetCurUserID() ) ); DrawRadioButton( setup->radioRefs[kAcceptChallengesButton] ); // Call Waiting: setup->radioRefs[kCallWaitingButton] = SetupRadioButton( kCallWaitingButton+1, nil ); RadioButtonSetSelection(setup->radioRefs[kCallWaitingButton], GetCallWaitingOption( GetCurUserID() ) ); DrawRadioButton(setup->radioRefs[kCallWaitingButton]); // Calling From: phoneString = (char *) GetBoxPhoneNumber()->phoneNumber; GetLocalAccessPhoneNumber(&local1, &local2); if ( local1->phoneNumber[0] == 0 ) { phoneString = GetSegaString(kBoxPhoneNumber); setup->newPhoneNumber = true; } else setup->newPhoneNumber = false; setup->radioRefs[kIMovedButton] = SetupRadioButton( kIMovedButton+1, phoneString ); RadioButtonSetSelection(setup->radioRefs[kIMovedButton], setup->newPhoneNumber || GetIMovedOption() ); DrawRadioButton( setup->radioRefs[kIMovedButton] ); // Keyboard Type: setup->radioRefs[kKeyboardButton] = SetupRadioButton( kKeyboardButton+1, nil ); RadioButtonSetSelection(setup->radioRefs[kKeyboardButton], GetQwertyKeyboardOption( GetCurUserID() ) ); DrawRadioButton( setup->radioRefs[kKeyboardButton] ); // Set active button setup->activeButton = kAcceptChallengesButton; ActivateRadioButton(setup->radioRefs[setup->activeButton]); VDPIdle(); // Set up the DITL setup->theDitlList = SetupDITLItemList( kXBandSetupScreen ); setup->myControlTable = SetupControlTable( kXBandSetupScreen ); NewDITL( setup->myControlTable, setup->theDitlList ); // Invalidate the description text setup->descriptionInvalid = true; return (long) setup; }
static long OptionsSetup( ScreenParams *params ) { OptionsRefCon *optionGlobals; CreditRecord *cred = (CreditRecord *)DBGetItem( kCreditsDBType, 0 ); RestrictionsRecord *rest = (RestrictionsRecord *)DBGetItem( kRestrictionsDBType, 0 ); char acctStr[8]; char smartCardStr[8]; char usedCredStr[8]; StatTextDesc *STDPtr; TextButtonDesc *TBDPtr; short screds; xyString *s; segaCharRect myRect; optionGlobals = (OptionsRefCon *) NewMemory( kTemp, sizeof(OptionsRefCon) ); EraseGDevice ( kScrollA ); SetBackdropID ( kType2PlainBackground, true, 0 ); optionGlobals->theDitlList = SetupDITLItemList( kAccountInfoScreen ); optionGlobals->myControlTable = SetupControlTable( kAccountInfoScreen ); optionGlobals->graphRef = DrawDBGraphicAt( 0, kAccountInfoIcon, 30, 3, kScrollB ); // pound Credits Used string SegaNumToString( (long)cred->usedCredits, usedCredStr ); STDPtr = (StatTextDesc *)((optionGlobals->theDitlList)->items[kTotalCreditsUsed].objectData); STDPtr->myCString = usedCredStr; // pound XBand Account string SegaNumToString( (long)cred->accountCredits, acctStr ); STDPtr = (StatTextDesc *)((optionGlobals->theDitlList)->items[kAccountCredits].objectData); STDPtr->myCString = acctStr; // setup for SmartCard Credits AutoPound optionGlobals->textRect.top = ((optionGlobals->theDitlList)->items[kSmartCardCredits].yPos >> 3); optionGlobals->textRect.bottom = optionGlobals->textRect.top + 2; optionGlobals->textRect.left = ((optionGlobals->theDitlList)->items[kSmartCardCredits].xPos >> 3); optionGlobals->textRect.right = optionGlobals->textRect.left + 6; // 6 cells wide // pound Playing Field string STDPtr = (StatTextDesc *)((optionGlobals->theDitlList)->items[kPlayingField].objectData); STDPtr->myCString = rest->playField; // pound Hours of Play strings STDPtr = (StatTextDesc *)((optionGlobals->theDitlList)->items[kHoursOfPlay1].objectData); STDPtr->myCString = rest->hours1; STDPtr = (StatTextDesc *)((optionGlobals->theDitlList)->items[kHoursOfPlay2].objectData); STDPtr->myCString = rest->hours2; // pound off the Return text s = (xyString *)DBGetItem( kStringType, 0 ); // ID 0 is the system null string TBDPtr = (TextButtonDesc *)((optionGlobals->theDitlList)->items[kReturnButton].objectData); TBDPtr->myCString = s->cString; NewDITL( optionGlobals->myControlTable, optionGlobals->theDitlList ); // finish setup for SmartCard Credits AutoPound SetCurrentDevice( kScrollA ); STDPtr = (StatTextDesc *)((optionGlobals->theDitlList)->items[kSmartCardCredits].objectData); optionGlobals->textPatterns = LinearizeScreenArea( &(optionGlobals->textRect), STDPtr->palette ); screds = GetRemainingCredits(0); DrawSmartCardCredits( optionGlobals, screds ); optionGlobals->cardDetected = 0; // Jizzle myRect.left = 3; myRect.top = 2; myRect.right = 36; myRect.bottom = 25; optionGlobals->myTextBoxMems = DrawTextBox( &myRect, 14, kScrollA ); StartTextBoxAnimation( optionGlobals->myTextBoxMems, 20 ); VDPIdle(); // let the shit update return (long)optionGlobals; }
void SimpleDrawTextAlign(cdCanvas* canvas) { int w, h, i, xoff, yoff, use_vector; int text_aligment[] = { CD_NORTH, CD_SOUTH, CD_EAST, CD_WEST, CD_NORTH_EAST, CD_NORTH_WEST, CD_SOUTH_EAST, CD_SOUTH_WEST, CD_CENTER, CD_BASE_CENTER, CD_BASE_RIGHT, CD_BASE_LEFT }; #if 1 char* text_aligment_str[] = { "North (Ãyj)\nSecond Line (Ãyj)\nThird Line", "South (Ãyj)\nSecond Line (Ãyj)\nThird Line", "East (Ãyj)\nSecond Line (Ãyj)\nThird Line", "West (Ãyj)\nSecond Line (Ãyj)\nThird Line", "North East (Ãyj)\nSecond Line (Ãyj)\nThird Line", "North West (Ãyj)\nSecond Line (Ãyj)\nThird Line", "South East (Ãyj)\nSecond Line (Ãyj)\nThird Line", "South West (Ãyj)\nSecond Line (Ãyj)\nThird Line", "Center (Ãyj)\nSecond Line (Ãyj)\nThird Line", "Base Center (Ãyj)\nSecond Line (Ãyj)\nThird Line", "Base Right (Ãyj)\nSecond Line (Ãyj)\nThird Line", "Base Left (Ãyj)\nSecond Line (Ãyj)\nThird Line" }; #else char* text_aligment_str[] = { "North (Ãyj)", "South (Ãyj)", "East (Ãyj)", "West (Ãyj)", "North East (Ãyj)", "North West (Ãyj)", "South East (Ãyj)", "South West (Ãyj)", "Center (Ãyj)", "Base Center (Ãyj)", "Base Right (Ãyj)", "Base Left (Ãyj)" }; #endif cdCanvasGetSize(canvas, &w, &h, 0, 0); cdCanvasBackground(canvas, CD_WHITE); cdCanvasClear(canvas); use_vector = 0; #if 0 if (use_vector) cdCanvasVectorTextDirection(canvas, 0, 0, 1, 1); else cdCanvasTextOrientation(canvas, 45); #endif xoff = w/4; yoff = h/7; if (use_vector) cdCanvasVectorCharSize(canvas, 30); else { //cdCanvasFont(canvas, "Times", CD_PLAIN, 14); cdCanvasFont(canvas, "Helvetica", CD_PLAIN, 24); } for (i = 0; i < 12; i++) { cdCanvasTextAlignment(canvas, text_aligment[i]); if (i < 6) { if (use_vector) DrawVectorTextBox(canvas, xoff, yoff*(i+1), text_aligment_str[i]); else DrawTextBox(canvas, xoff, yoff*(i+1), text_aligment_str[i]); } else { if (use_vector) DrawVectorTextBox(canvas, 3*xoff, yoff*(i-5), text_aligment_str[i]); else DrawTextBox(canvas, 3*xoff, yoff*(i-5), text_aligment_str[i]); } } }