Re: [NTG-context] Laundry symbols (now: altered picture)
Great! Thanks Hans, now it works. I replaced the "draw externalfigure" commands by draw externalfigure "./skysprite.png" xsized 4u ysized 5u shifted (0u,-0u); draw externalfigure "./sandsprite.png" xsized 4u ysized 5u shifted (0u,-5u); Best regards On Sun, Jan 2, 2022 at 3:36 PM Hans Hagen wrote: > On 1/2/2022 3:12 PM, Alfredo Catalina via ntg-context wrote: > > I'm trying to use ConTeXt with Metafun to produce a map of a videogame I > > am working on. In fact I did it 9 years ago but it seems that now it > > doesn't work. > > > > I have two 32 pixels wide by 40 pixels high sprites. They are saved in > > the skysprite.png and sandsprite.png files. Since 32 = 4 x 8 and 40 = 5 > > x 8, the width/height ratio is 4/5. > > > > This should produce a page with a sky sprite and a sand sprite, one > > below the other. It worked in the past. Each sprite should be 4 x 0.095 > > cm = 0,38 cm wide and 5 x 0.095 cm = 0.475 cm high: > > > > \starttext > > \setupMPinstance[metafun][textstyle={\switchtobodyfont[termes,8pt]}] > > \startuseMPgraphic{mapa} > > u:=.095cm; > > draw externalfigure "./skysprite.png" xscaled 4u yscaled 5u shifted > > (0u,-0u); > > draw externalfigure "./sandsprite.png" xscaled 4u yscaled 5u shifted > > (0u,-5u); > > \stopuseMPgraphic > > \useMPgraphic{mapa} > > \stoptext > > > > But instead I got two huge sprites of 2.8 cm x 4.4 cm. > > > > Am I forgetting something? > Originally that worked because the image was always 'included' at 1 bp > and then scaled but that was (1) inaccurate and (2) a bit depending on > the image and (3) could overflow metapost. > > Use xsized and ysized instead (absolute measures instead of scaling the > unknown) > > Hans > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
On 1/2/2022 3:12 PM, Alfredo Catalina via ntg-context wrote: I'm trying to use ConTeXt with Metafun to produce a map of a videogame I am working on. In fact I did it 9 years ago but it seems that now it doesn't work. I have two 32 pixels wide by 40 pixels high sprites. They are saved in the skysprite.png and sandsprite.png files. Since 32 = 4 x 8 and 40 = 5 x 8, the width/height ratio is 4/5. This should produce a page with a sky sprite and a sand sprite, one below the other. It worked in the past. Each sprite should be 4 x 0.095 cm = 0,38 cm wide and 5 x 0.095 cm = 0.475 cm high: \starttext \setupMPinstance[metafun][textstyle={\switchtobodyfont[termes,8pt]}] \startuseMPgraphic{mapa} u:=.095cm; draw externalfigure "./skysprite.png" xscaled 4u yscaled 5u shifted (0u,-0u); draw externalfigure "./sandsprite.png" xscaled 4u yscaled 5u shifted (0u,-5u); \stopuseMPgraphic \useMPgraphic{mapa} \stoptext But instead I got two huge sprites of 2.8 cm x 4.4 cm. Am I forgetting something? Originally that worked because the image was always 'included' at 1 bp and then scaled but that was (1) inaccurate and (2) a bit depending on the image and (3) could overflow metapost. Use xsized and ysized instead (absolute measures instead of scaling the unknown) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
I'm trying to use ConTeXt with Metafun to produce a map of a videogame I am working on. In fact I did it 9 years ago but it seems that now it doesn't work. I have two 32 pixels wide by 40 pixels high sprites. They are saved in the skysprite.png and sandsprite.png files. Since 32 = 4 x 8 and 40 = 5 x 8, the width/height ratio is 4/5. This should produce a page with a sky sprite and a sand sprite, one below the other. It worked in the past. Each sprite should be 4 x 0.095 cm = 0,38 cm wide and 5 x 0.095 cm = 0.475 cm high: \starttext \setupMPinstance[metafun][textstyle={\switchtobodyfont[termes,8pt]}] \startuseMPgraphic{mapa} u:=.095cm; draw externalfigure "./skysprite.png" xscaled 4u yscaled 5u shifted (0u,-0u); draw externalfigure "./sandsprite.png" xscaled 4u yscaled 5u shifted (0u,-5u); \stopuseMPgraphic \useMPgraphic{mapa} \stoptext But instead I got two huge sprites of 2.8 cm x 4.4 cm. Am I forgetting something? Thanks ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
... OK, much clearer now. Thanks for explanation. Best regards, Lukas On Tue, 05 Jun 2012 18:06:28 +0200, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: Am 05.06.2012 um 17:13 schrieb Procházka Lukáš Ing. - Pontex s. r. o.: Thank you, Wolfgang. Two more questions, hope there'll be no more about this stuff. On Tue, 05 Jun 2012 17:01:28 +0200, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: \usesymbols[mvs] \starttext \symbol[martinvogel 2][ShortForty] \stoptext or \usesymbols[mvs] \setupsymbolset[martinvogel 2] \starttext \symbol[ShortForty] \stoptext Wolfgang - How to scale the desired symbol, e.g. 5 times? I played with scale somehow, but no effect. It scales with the current font size. \usesymbols[mvs] \setupsymbolset[martinvogel 2] \starttext \symbol[ShortForty] {\tfd\symbol[ShortForty]} \stoptext - Where the symbol set name martinvogel 2 comes from? Is it a name built in the font file? The symbols are defined in symb-imp-mvs.mkiv, with \usesymbols[…] you load the file. - - Is 2 part of the name or does it mean something, e.g. a factor? The symbols are just put in named groups and “martinvogel 2” is the name of one of these groups (there is also “martinvogel 1”, don’t know how created these names). When you define a symbol you can set the name as \definesymbol[name]{symbol} or out it in a category with \definesymbol[category][name]{symbol} When you have many symbols which you want to put in a category you can say \startsymbolset [category] \definesymbol[name 1]{symbol 1} \definesymbol[name 2]{symbol 2} \stopsymbolset and omit the first argument. To print a symbol from this symbolset you have to write \symbol[category][name] but when you add \setupsymbolset[category] to your document ConTeXt will search in this symbol set even when you write only \symbol[name] Wolfgang -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Laundry symbols (now: altered picture)
Hello ConTeXters, is there a way how to get laundry symbols into ConTeXt? - The image is copied from The Comprehensive LATEX Symbol List, Scott Pakin. TIA. Best regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038attachment: LaunSyms3.png___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
On 2012-06-05 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz wrote: is there a way how to get laundry symbols into ConTeXt? The proper way would be to use ConTeXts symbol mechanism. I guess the symbols can then be accessed my name. However, I didn't find the laundry symbol names in any MkIV file in the distribution. It seems that nobody maintained an up-to-date list. You can always access the characters directly: \getglyph{marvosym}{\char 247} To find out which symbols are at which slot, use \showfont [marvosym] Marco ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
Am 05.06.2012 um 16:26 schrieb Marco: On 2012-06-05 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz wrote: is there a way how to get laundry symbols into ConTeXt? The proper way would be to use ConTeXts symbol mechanism. I guess the symbols can then be accessed my name. However, I didn't find the laundry symbol names in any MkIV file in the distribution. It seems that nobody maintained an up-to-date list. You can always access the characters directly: \getglyph{marvosym}{\char 247} To find out which symbols are at which slot, use \showfont [marvosym] It’s easier to create a list with all symbols and their names. \usesymbols[mvs] \starttext \showsymbolset[martinvogel 2] \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
... Thanks both for your answers. My code so far is: \usesymbols[mvs] \starttext \startcolumns[n=2,rule=on] \showsymbolset[martinvogel 2] \stopcolumns \page \startcolumns[n=4,rule=on] \dorecurse{1024}{\recurselevel --\getglyph{marvosym}{\char\recurselevel\par}} \stopcolumns \stoptext And how to access symbols by their names, e.g. how to use symbol named AtForty? - The symbol list shows only symbolic names, not values (to be used with Marco's \char value). \AtForty gives error, so is it to be used with \usesymbol or \symbol or something like that? Lukas On Tue, 05 Jun 2012 16:32:49 +0200, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: \getglyph{marvosym}{\char 247} To find out which symbols are at which slot, use \showfont [marvosym] It’s easier to create a list with all symbols and their names. \usesymbols[mvs] \starttext \showsymbolset[martinvogel 2] \stoptext -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 Laundry.mkiv Description: Binary data ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
Am 05.06.2012 um 16:57 schrieb Procházka Lukáš Ing. - Pontex s. r. o.: ... Thanks both for your answers. My code so far is: \usesymbols[mvs] \starttext \startcolumns[n=2,rule=on] \showsymbolset[martinvogel 2] \stopcolumns \page \startcolumns[n=4,rule=on] \dorecurse{1024}{\recurselevel --\getglyph{marvosym}{\char\recurselevel\par}} \stopcolumns \stoptext And how to access symbols by their names, e.g. how to use symbol named AtForty? - The symbol list shows only symbolic names, not values (to be used with Marco's \char value). \AtForty gives error, so is it to be used with \usesymbol or \symbol or something like that? \usesymbols[mvs] \starttext \symbol[martinvogel 2][ShortForty] \stoptext or \usesymbols[mvs] \setupsymbolset[martinvogel 2] \starttext \symbol[ShortForty] \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
Thank you, Wolfgang. Two more questions, hope there'll be no more about this stuff. On Tue, 05 Jun 2012 17:01:28 +0200, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: \usesymbols[mvs] \starttext \symbol[martinvogel 2][ShortForty] \stoptext or \usesymbols[mvs] \setupsymbolset[martinvogel 2] \starttext \symbol[ShortForty] \stoptext Wolfgang - How to scale the desired symbol, e.g. 5 times? I played with scale somehow, but no effect. - Where the symbol set name martinvogel 2 comes from? Is it a name built in the font file? - - Is 2 part of the name or does it mean something, e.g. a factor? Thanks again. Best regards, Lukas -- Ing. Lukáš Procházka [mailto:l...@pontex.cz] Pontex s. r. o. [mailto:pon...@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
Am 05.06.2012 um 17:13 schrieb Procházka Lukáš Ing. - Pontex s. r. o.: Thank you, Wolfgang. Two more questions, hope there'll be no more about this stuff. On Tue, 05 Jun 2012 17:01:28 +0200, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: \usesymbols[mvs] \starttext \symbol[martinvogel 2][ShortForty] \stoptext or \usesymbols[mvs] \setupsymbolset[martinvogel 2] \starttext \symbol[ShortForty] \stoptext Wolfgang - How to scale the desired symbol, e.g. 5 times? I played with scale somehow, but no effect. It scales with the current font size. \usesymbols[mvs] \setupsymbolset[martinvogel 2] \starttext \symbol[ShortForty] {\tfd\symbol[ShortForty]} \stoptext - Where the symbol set name martinvogel 2 comes from? Is it a name built in the font file? The symbols are defined in symb-imp-mvs.mkiv, with \usesymbols[…] you load the file. - - Is 2 part of the name or does it mean something, e.g. a factor? The symbols are just put in named groups and “martinvogel 2” is the name of one of these groups (there is also “martinvogel 1”, don’t know how created these names). When you define a symbol you can set the name as \definesymbol[name]{symbol} or out it in a category with \definesymbol[category][name]{symbol} When you have many symbols which you want to put in a category you can say \startsymbolset [category] \definesymbol[name 1]{symbol 1} \definesymbol[name 2]{symbol 2} \stopsymbolset and omit the first argument. To print a symbol from this symbolset you have to write \symbol[category][name] but when you add \setupsymbolset[category] to your document ConTeXt will search in this symbol set even when you write only \symbol[name] Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___