flat assembler
Message board for the users of flat assembler.
Index
> Windows > RichEdit 6.0 and Math Zones: |
Author |
|
bitRAKE 27 May 2008, 15:23
Disclaimer #1:
I'm not a lawyer, but I'm fairly certain version 6.0 RICHED20.DLL and the Cambria fonts cannot be distributed without permission from Microsoft. If your clients have Office 2007, or Microsoft Math then it's installed. Getting RichEdit version 6.0 and Cambria fonts:
Disclaimer #2: RICHED20.DLL 6.0 will break other software if installed over the windows directory version. Just put it in the application directory or load from some obscure location. Translation from Murray Sargent's (long time RichEdit developer) blog: (Read link above because you'll need the constants and execution environment specifics if you intend to use this code, and the blog is very informative in general.) Code: ToggleMathZone: sub esp,sizeof.CHARFORMAT2W - 4 pushd sizeof.CHARFORMAT2W ; return address and three arguments to SendMessage, plus structure on stack label .hWndRE dword at esp+16+sizeof.CHARFORMAT2W invoke SendMessage,[.hWndRE],EM_GETCHARFORMAT,SCF_SELECTION or SCF_ONLYCFEFFECTS,esp btc [esp+CHARFORMAT2W.dwEffects+3],4 ; CFE_MATH ; test & Toggle math zone flag jc .off ; Turn on LineServices invoke SendMessage,[.hWndRE],EM_SETTYPOGRAPHYOPTIONS,TO_ADVANCEDTYPOGRAPHY,TO_ADVANCEDTYPOGRAPHY ; Enable built-in math autocorrect invoke SendMessage,[.hWndRE],EM_SETADJUSTTEXTPROC,1,0 virtual at 0 du "Cambria Math" du LF_FACESIZE dup (0) ; create set of data constants rept 16 i:0 { load ___data#i dword from 4*i } macro SETFACE dest { rept 16 i:0 \{ mov dword[(dest)+4*i],___data\#i \} } end virtual SETFACE esp+CHARFORMAT2W.szFaceName mov [esp+CHARFORMAT2W.lcid],MATH_LCID mov [esp+CHARFORMAT2W.dwMask],CFM_MATH or CFM_FACE or CFM_LCID invoke SendMessage,[.hWndRE],EM_SETCHARFORMAT,SCF_SELECTION or SCF_ONLYCFEFFECTS,esp add esp,sizeof.CHARFORMAT2W retn 4 .off: mov [esp+CHARFORMAT2W.dwMask],CFM_MATH invoke SendMessage,[.hWndRE],EM_SETCHARFORMAT,SCF_SELECTION or SCF_ONLYCFEFFECTS,esp add esp,sizeof.CHARFORMAT2W retn 4 Just "stdcall ToggleMathZone,[hRE]" to create a Math Zone. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup Last edited by bitRAKE on 27 May 2008, 16:43; edited 1 time in total |
|||
27 May 2008, 15:23 |
|
bitRAKE 27 May 2008, 16:07
http://research.microsoft.com/workshops/fs2006/presentations/17_Sargent_071706.ppt
You should learn how to use your home page. .hWndRE is a local label - the first argument on the stack. Might want to read the blog entry linked to in the first post. Not only does it set the font (special font, btw), but it enables some advanced typography features and autocorrection. Basically, you need a RichEdit control handle. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
27 May 2008, 16:07 |
|
revolution 27 May 2008, 16:27
bitRAKE wrote: http://research.microsoft.com/workshops/fs2006/presentations/17_Sargent_071706.ppt bitRAKE wrote: .hWndRE is a local label - the first argument on the stack. bitRAKE wrote: Might want to read the blog entry linked to in the first post. Not only does it set the font (special font, btw), but it enables some advanced typography features and autocorrection. Basically, you need a RichEdit control handle. Shucks, I need to take a break, been working too hard. |
|||
27 May 2008, 16:27 |
|
bitRAKE 28 May 2008, 02:54
The version of RICHED20.DLL with Microsoft Math is actually 12.0.16.1019 -- it's the control within the DLL which is version 6.0, class name "RICHEDIT60W". Unfortunately, I cannot post the DLL or needed fonts, but I can attach an example program for those who'd like to try it out.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
28 May 2008, 02:54 |
|
bitRAKE 01 Jun 2008, 05:11
Math Zone syntax is fairly easy, imho. Auto-correction will convert symbol names to the symbol (e.g. \alpha, \theta), and automatically create syntax groups based on function names or start/end synbols (e.g. matching (), {}, [], etc.). Also, there are built-in macros (\binomial, \integral, \limit, \quadratic, ...), but I haven't figured out how to create custom macros. No doubt there is some official documentation somewhere.
_________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
||||||||||
01 Jun 2008, 05:11 |
|
bitRAKE 27 Jun 2008, 02:13
Found some good instruction on using Math Zones:
http://ist.uwaterloo.ca/ec/equations/equation2007.html The best guide as is really: http://unicode.org/notes/tn28/UTN28-PlainTextMath-v2.pdf All the keyboard entry I've tried so far seems to work. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
27 Jun 2008, 02:13 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.