How to add new commands for Math

classic Classic list List threaded Threaded
10 messages Options
Rodolfo R Gomes Rodolfo R Gomes
Reply | Threaded
Open this post in threaded view
|

How to add new commands for Math

Hi. I'm new here at LibO development.

I have interest on improve the Math component of LibreOffice by adding
some new commands into it: things like a wide inverted breve for
description of an arc between points A and B.

In order to do so, I've been looking & changing files with WideVec in
starmath module (files like starmath.h, commands.src, parse.cxx, etc).
Not successfully, though. My "wideibreve" attribute command isn't even
recognized as a command: its texts appears normally.

I know it's kinda vague, but any guides what I should do for add any
new command? And how to put it into the toolbox?

Regards,
Rodolfo
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Meeks Michael Meeks
Reply | Threaded
Open this post in threaded view
|

Re: How to add new commands for Math

Hi there,

On Fri, 2011-06-10 at 08:56 -0300, Rodolfo wrote:
> Hi. I'm new here at LibO development.

        Welcome ! :-) fantastic to have you.

> I have interest on improve the Math component of LibreOffice by adding
> some new commands into it: things like a wide inverted breve for
> description of an arc between points A and B.

        Sounds exciting.

> In order to do so, I've been looking & changing files with WideVec in
> starmath module (files like starmath.h, commands.src, parse.cxx, etc).
> Not successfully, though. My "wideibreve" attribute command isn't even
> recognized as a command: its texts appears normally.

        Oh - that sucks; any chance you can send a patch so we can have a read
through / play here ? [ always good to talk code ].

> I know it's kinda vague, but any guides what I should do for add any
> new command? And how to put it into the toolbox?

        I just had a poke; UI stuff is in .src files - in this case
starmath/source/toolbox.src - you would need to add a new magic number
in a .hrc file for that button (I guess), and then the src files are
associated with source files via those #define magic names. so eg. git
grep for RID_XCDOTY.

        Having said that - in this case, there seems to be some magic, whereby
the toolboxitem identifier, is also the identifier of another string
that is a command ;-)

        Looks like you'd just want to add a new entry for each of those &
bingo :-)

        Are you on IRC ? poke me mmeeks on #libreoffice-dev on freenode for
something more interactive.

        Hope that helps !

                Michael.

--
 [hidden email]  <><, Pseudo Engineer, itinerant idiot


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Rodolfo R Gomes Rodolfo R Gomes
Reply | Threaded
Open this post in threaded view
|

Re: How to add new commands for Math

Michael,

Thank you. I almost could do what I'm supposed to (thanks tml and moggi).

But I now have another issue: the OpenSymbol font doesn't have all
math operators mentioned by Unicode (like "there does not exist"
0x2204) and some diacritics like inverted breve(ligature) (0x0361).

How can it be done?

And how can I got some MathType documentation to know how to export it
these new data?


Regards,
Rodolfo

2011/6/10 Michael Meeks <[hidden email]>:

> Hi there,
>
> On Fri, 2011-06-10 at 08:56 -0300, Rodolfo wrote:
>> Hi. I'm new here at LibO development.
>
>        Welcome ! :-) fantastic to have you.
>
>> I have interest on improve the Math component of LibreOffice by adding
>> some new commands into it: things like a wide inverted breve for
>> description of an arc between points A and B.
>
>        Sounds exciting.
>
>> In order to do so, I've been looking & changing files with WideVec in
>> starmath module (files like starmath.h, commands.src, parse.cxx, etc).
>> Not successfully, though. My "wideibreve" attribute command isn't even
>> recognized as a command: its texts appears normally.
>
>        Oh - that sucks; any chance you can send a patch so we can have a read
> through / play here ? [ always good to talk code ].
>
>> I know it's kinda vague, but any guides what I should do for add any
>> new command? And how to put it into the toolbox?
>
>        I just had a poke; UI stuff is in .src files - in this case
> starmath/source/toolbox.src - you would need to add a new magic number
> in a .hrc file for that button (I guess), and then the src files are
> associated with source files via those #define magic names. so eg. git
> grep for RID_XCDOTY.
>
>        Having said that - in this case, there seems to be some magic, whereby
> the toolboxitem identifier, is also the identifier of another string
> that is a command ;-)
>
>        Looks like you'd just want to add a new entry for each of those &
> bingo :-)
>
>        Are you on IRC ? poke me mmeeks on #libreoffice-dev on freenode for
> something more interactive.
>
>        Hope that helps !
>
>                Michael.
>
> --
>  [hidden email]  <><, Pseudo Engineer, itinerant idiot
>
>
>
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|

Re: How to add new commands for Math

On Sun, 2011-06-12 at 21:25 -0300, Rodolfo wrote:
> I now have another issue: the OpenSymbol font doesn't have all
> math operators mentioned by Unicode (like "there does not exist"
> 0x2204) and some diacritics like inverted breve(ligature) (0x0361).
>
> How can it be done?

Edit opensymbol in extras/source/symbols/source/truetype/symbol and add
the glyphs that are missing (and bump the release version of the font) ?

> And how can I got some MathType documentation to know how to export it
> these new data?

MathType is actually documented in the MathType sdk IIRC, i.e.
http://www.dessci.com/en/reference/sdk/

C.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Regina Henschel Regina Henschel
Reply | Threaded
Open this post in threaded view
|

Re: How to add new commands for Math

In reply to this post by Rodolfo R Gomes
Hi Rodolf, hi all,

Rodolfo schrieb:
> Michael,
>
> Thank you. I almost could do what I'm supposed to (thanks tml and moggi).
>
> But I now have another issue: the OpenSymbol font doesn't have all
> math operators mentioned by Unicode (like "there does not exist"
> 0x2204) and some diacritics like inverted breve(ligature) (0x0361).
>
> How can it be done?

I think, that it needs a more general discussion. I see no license
information in the opens___.ttf file. But I guess, that SUN/Oracle holds
the copyright on that font. So it might be, that it is not possible to
add new symbols.

My suggestion -not to you personally but in general- is to deliver the
STIX fonts and change totally from OpenSymbol to STIX. The STIX fonts
have all the math symbols someone needs.

http://www.stixfonts.org/

Kind regards
Regina

>
> And how can I got some MathType documentation to know how to export it
> these new data?
>
>
> Regards,
> Rodolfo
>
> 2011/6/10 Michael Meeks<[hidden email]>:
>> Hi there,
>>
>> On Fri, 2011-06-10 at 08:56 -0300, Rodolfo wrote:
>>> Hi. I'm new here at LibO development.
>>
>>         Welcome ! :-) fantastic to have you.
>>
>>> I have interest on improve the Math component of LibreOffice by adding
>>> some new commands into it: things like a wide inverted breve for
>>> description of an arc between points A and B.
>>
>>         Sounds exciting.
>>
>>> In order to do so, I've been looking&  changing files with WideVec in
>>> starmath module (files like starmath.h, commands.src, parse.cxx, etc).
>>> Not successfully, though. My "wideibreve" attribute command isn't even
>>> recognized as a command: its texts appears normally.
>>
>>         Oh - that sucks; any chance you can send a patch so we can have a read
>> through / play here ? [ always good to talk code ].
>>
>>> I know it's kinda vague, but any guides what I should do for add any
>>> new command? And how to put it into the toolbox?
>>
>>         I just had a poke; UI stuff is in .src files - in this case
>> starmath/source/toolbox.src - you would need to add a new magic number
>> in a .hrc file for that button (I guess), and then the src files are
>> associated with source files via those #define magic names. so eg. git
>> grep for RID_XCDOTY.
>>
>>         Having said that - in this case, there seems to be some magic, whereby
>> the toolboxitem identifier, is also the identifier of another string
>> that is a command ;-)
>>
>>         Looks like you'd just want to add a new entry for each of those&
>> bingo :-)
>>
>>         Are you on IRC ? poke me mmeeks on #libreoffice-dev on freenode for
>> something more interactive.
>>
>>         Hope that helps !
>>
>>                 Michael.
>>
>> --
>>   [hidden email]<><, Pseudo Engineer, itinerant idiot
>>
>>
>>
> _______________________________________________
> LibreOffice mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Meeks Michael Meeks
Reply | Threaded
Open this post in threaded view
|

Re: How to add new commands for Math

In reply to this post by Caolán McNamara

On Mon, 2011-06-13 at 12:50 +0100, Caolán McNamara wrote:
> Edit opensymbol in extras/source/symbols/source/truetype/symbol and add
> the glyphs that are missing (and bump the release version of the font) ?

        In more detail - you want to use fontforge to do that ;-)

        Caolan - I'd love to hear your take on Regina's idea - can we use
STIX ? - Regina, the idea of opensymbol is also to be metric compatible
with the old Microsoft symbol fonts - does STIX have the same goal
there ?

        Thanks,

                Michael.

--
 [hidden email]  <><, Pseudo Engineer, itinerant idiot


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|

Re: How to add new commands for Math

On Mon, 2011-06-13 at 14:21 +0100, Michael Meeks wrote:
> On Mon, 2011-06-13 at 12:50 +0100, Caolán McNamara wrote:
> > Edit opensymbol in extras/source/symbols/source/truetype/symbol and add
> > the glyphs that are missing (and bump the release version of the font) ?
>
> In more detail - you want to use fontforge to do that ;-)
>
> Caolan - I'd love to hear your take on Regina's idea - can we use
> STIX ?

Well, on the face of it, it sounds plausible. Did all the private area
codes get moved out in the last opensymbol release with code to map uses
in legacy documents to the new "proper" areas, or did they remain in
there for backwards compatibility.

>  - Regina, the idea of opensymbol is also to be metric compatible
> with the old Microsoft symbol fonts - does STIX have the same goal
> there ?

yeah, that'd be the nuisance bit, that if e.g. opensymbol was dropped
then stix is presumably going to have different metrics causing existing
docs to potentially change layout. It wouldn't be a massive biggy I
guess to keep opensymbol around for old documents if necessary, move to
Stix for new, and code up some new mappings for any gotchas.

C.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Rodolfo R Gomes Rodolfo R Gomes
Reply | Threaded
Open this post in threaded view
|

Re: How to add new commands for Math

In reply to this post by Regina Henschel
Hi Regina and everyone.

Indeed, the Stix fonts (STIXGeneral) work perfectly.

I don't know about the metrics issues mentioned by Michael Meeks, though.

Any help?

Regards
Rodolfo



2011/6/13 Regina Henschel <[hidden email]>:

> Hi Rodolf, hi all,
>
> Rodolfo schrieb:
>>
>> Michael,
>>
>> Thank you. I almost could do what I'm supposed to (thanks tml and moggi).
>>
>> But I now have another issue: the OpenSymbol font doesn't have all
>> math operators mentioned by Unicode (like "there does not exist"
>> 0x2204) and some diacritics like inverted breve(ligature) (0x0361).
>>
>> How can it be done?
>
> I think, that it needs a more general discussion. I see no license
> information in the opens___.ttf file. But I guess, that SUN/Oracle holds the
> copyright on that font. So it might be, that it is not possible to add new
> symbols.
>
> My suggestion -not to you personally but in general- is to deliver the STIX
> fonts and change totally from OpenSymbol to STIX. The STIX fonts have all
> the math symbols someone needs.
>
> http://www.stixfonts.org/
>
> Kind regards
> Regina
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Thorsten Behrens Thorsten Behrens
Reply | Threaded
Open this post in threaded view
|

Re: Stix fonts / OpenSymbol replacements (was: Re: How to add new commands for Math)

Rodolfo wrote:
> Indeed, the Stix fonts (STIXGeneral) work perfectly.
>
> I don't know about the metrics issues mentioned by Michael Meeks, though.
>
Hi,

so to make progress here, someone would need to research whether
Stix is metric-compatible to OpenSymbol, and if not, fallback to
OpenSymbol for those glyphs that are there. Breaking layout for MS
docs / older documents is not an option, I'm afraid.

Herbert, do you happen to have insight into this?

Cheers,

-- Thorsten

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

attachment0 (205 bytes) Download Attachment
Caolán McNamara Caolán McNamara
Reply | Threaded
Open this post in threaded view
|

Re: Stix fonts / OpenSymbol replacements (was: Re: How to add new commands for Math)

On Wed, 2011-06-29 at 11:20 +0200, Thorsten Behrens wrote:

> Rodolfo wrote:
> > Indeed, the Stix fonts (STIXGeneral) work perfectly.
> >
> > I don't know about the metrics issues mentioned by Michael Meeks, though.
> >
> Hi,
>
> so to make progress here, someone would need to research whether
> Stix is metric-compatible to OpenSymbol, and if not, fallback to
> OpenSymbol for those glyphs that are there. Breaking layout for MS
> docs / older documents is not an option, I'm afraid.

Grab both fonts, have a look with fontforge or ttx if the glyphs in
opensymbol happen to have the same widths and heights ?, check leading
as well ?.

Quick sanity-check inspection: Grab both fonts, check what glyphs are in
opensymbol, insert them all into a writer document, export it to pdf.
Select all text, change it to StiX, export it to another pdf. See if
there are the same number of pages in both pdfs anyway, and if there
are, then see if the last bounding box of the last char is in the same
place.

C.

_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice