Definir font richedit5

Definir font richedit5

Postby jpcavagnaro » Sat Dec 23, 2023 10:28 am

Hola gente, como puedo definir el font por defecto Arial en lugar de MS Sans
Jorge
Saludos.
jpcavagnaro
 
Posts: 155
Joined: Tue Oct 11, 2016 1:02 pm
Location: Luján, bs. as.

Re: Definir font richedit5

Postby cnavarro » Sun Dec 24, 2023 10:47 am

Look commad for RICHEDT5
#command @ <nTop>, <nLeft> RICHEDIT5 [ <oRTF> VAR ] <uVar> ;
[ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FONT <oFont> ] ;
[ <pixel: PIXEL> ] ;
[ MESSAGE <cMsg> ] ;
[ <lHScroll: HSCROLL> ] ;
[ <readonly: READONLY, NO MODIFY> ] ;
[ WHEN <uWhen> ] ;
[ VALID <uValid> ] ;
[ ON CHANGE <uChange> ] ;
[ <lDesign: DESIGN> ] ;
[ <lHighlight: HIGHLIGHT> ] ;
[ <file: FILE, FILENAME> <cFileName> ] ;
[ RTFSIZE <nRTFSize> ] ;
[ <lNoURL: NO URL> ] ;
[ <lNoScroll: NO SCROLL> ] ;
[ <lNoBorder: NOBORDER, NO BORDER> ] ;
[ MARGINLEFT <nLeftMargin> ] ;
[ <lBar: BARBUTTON> ] ;

or when you define your control, use
Code: Select all  Expand view  RUN

    oRtf5:SetFont( oMyFont )
 

Try, please
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Definir font richedit5

Postby jpcavagnaro » Tue Dec 26, 2023 11:02 pm

Gracias por responder, lo llamaba así: RichEdit5( @xHecho, "Desvio", 9, 9, 30, 140 )
sin definir en el programa, lo que hice fue definir:


Function RichEdit5( cText, cTitle, nTop, nLeft, nBottom, nRight )

local oFont, oDlg
local hDLL
local uTemp := If( ! Empty( cText ), cText, '' )
local lRich := .F., lGTF := .F., lOk := .F.
publ oMemo

DEFAULT nTop := 9, nLeft := 9, nBottom := 27, nRight := 71.5, ;
cTitle := "RichEdit5"

* DEFINE FONT oFont NAME "Arial" SIZE 0, - 14

oFont := TFont():New( 'Arial', 0, -15 , .f.,.f., 0*10,,,,,,,,,, )


DEFINE DIALOG oDlg FROM nTop, nLeft TO nBottom, nRight ;
TITLE cTitle FONT oFont
oDlg:lTruePixel := .F.
oDlg:lHelpIcon := .F.

@ 30, 3 RICHEDIT5 oMemo VAR uTemp OF oDlg PIXEL SIZE 200, 200

oDlg:oClient = oMemo

omemo:SetFont( oFont )

ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( oMemo:LoadRtf( cText ), oMemo:PostMsg( WM_KEYDOWN, VK_HOME, 0 ) , BuildRichEditBar( oDlg, oMemo, { | c | cText := c } ), oDlg:ReSize(), SendMessage( oMemo:hWnd, EM_SETLANGOPTIONS, 0, nOr( IMF_SPELLCHECKING, IMF_TKBPREDICTION, IMF_TKBAUTOCORRECTION ) ) )

oFont:End()

return lOk


Así funciono perfecto, muchas gracias
Jorge
Saludos.
jpcavagnaro
 
Posts: 155
Joined: Tue Oct 11, 2016 1:02 pm
Location: Luján, bs. as.

Re: Definir font richedit5

Postby Otto » Wed Dec 27, 2023 8:41 am

Factors that could influence the future of Rich Text Editors


Hello friends,

Shouldn't we consider developing an alternative to RichEdit in parallel using WebView, e.g., with the TinyMCE editor?
I'm just thinking to be prepared for the future. That won't happen overnight.

Factors that could influence the future of Rich Text Editors.
There is a rising demand for more user-friendly and flexible editors that work across various platforms and devices. Developers might continue to add features such as drag-and-drop editing, enhanced multimedia support, and better integration with cloud services.

The integration of real-time collaboration features similar to Google Docs could be a crucial component of future Rich Text Editors. This would allow users to collaboratively and synchronously edit documents.

Optimizing Rich Text Editors for mobile devices is an important trend, as more users work on mobile.

TinyMCE:
A lightweight yet powerful WYSIWYG editor that can be easily integrated into web applications. TinyMCE is customizable and offers a variety of plugins to expand its functionality.


Regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6346
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 99 guests