HOME > é»ç® > Inkscape ã¡ã¢
Inkscape ã¡ã¢
Inkscape ãããŒãžã§ã³ãäžãã£ãŠããã®ããŒãžãäžæ°ããå¿ èŠãåºãŠããããšããããšã§ã挞ã ã«äœæ¥ãé²ãããïŒå€ãããŒãžïŒ
ç®æ¬¡
æŠç¥
Inkscape éæ
æšæºä¿ååœ¢åŒ Inkscape SVG
Inkscape ã®æ¡åŒµã¹ã¯ãªãã
ããŸãââé·æ¹åœ¢ãåãã·ã§ã¢ã«ããåå²ãã Inkscape ã®æ¡åŒµã¹ã¯ãªãã
ä»ã®ãã¡ã€ã«åœ¢åŒã®èªã¿æžã
åäœã®ããš
SVG ããèŠã Inkscape ã®æ©èœ(ã¯ããŒã³ãšã³ããŒãã¬ã€ã€ãŒãå€åœ¢ãæåã³ãŒããããã¹ãã®æµã蟌ã¿ãèæ¯è²ãããŒã«ããã¹ãå¡ãã€ã¶ã
æŠç¥
Inkscape ã¯ãLinux, Windows, Mac OS X ãªã©ã®ãã©ããããŒã ã§åäœãããªãŒãã³ãœãŒã¹ãã€ããªãŒã®ãããŒã€ã³ã°ã»ããŒã«ïŒãããŒã»ãœããïŒã§ãããSVG ãšãã圢åŒã«ãã€ãã£ãã«å¯Ÿå¿ããŠããã®ãèããç¹åŸŽãé¢çœããªãšæã£ãããšããåå¿é²ã€ãã§ã«ã¡ã¢ããŠããïŒåœç¶èª€ããå«ãŸããŠããããšæãããâŠâŠïŒãã¡ãªã¿ã«ãç§ã¯ Ubuntu(Linux ã®äžãã£ã¹ããªãã¥ãŒã·ã§ã³)äžã§ Version 0.4.6ïŒãªãªãŒã¹ããŒãïŒã䜿ã£ãŠããã
Inkscape éæ
ããªãŒã®ãããŒãœããïŒãããŒã€ã³ã°ã»ããŒã«ïŒã®ãªãã§ãæã䜿ããããããã«æããã
Inkscape 㯠SVG ã«ãã€ãã£ãã«å¯Ÿå¿ããŠãããSVG 㯠XML ãªã®ã§ãåºæ¬çã«ããã¹ãæžé¡ã§ããããã®ããšããä»ã®ããã°ã©ã ãã¹ã¯ãªããã®é£æºãèãã容æãªãã®ã«ããŠãããããŸããŸãªãã©ãŒãããã®ç»åãéããããç·šéäžã«äœ¿ããæå¿«ãªæ¡åŒµã¹ã¯ãªããã䜿ã£ããããããšãªãã°ããã¹ããšãã£ã¿ã§äžèº«ãç·šéããããšãã§ããã
ãè·äººã®æ¥ãã³ã³ãã¥ãŒã¿äžã§åçŸã§ããããã«ãŸããŠãŒã¶ã»ã€ã³ã¿ãŒãã§ãŒã¹èããŠããããå®çŸããããã«ããŒã¿æ§é ã決ããããŠããã®ããçµµæããœãããšãããã®ã ããšèããŠãããšãInkscape ã¯å®é以äžã«è³ªçŽ ãªãã®ã«èŠãããããããSVG ãšããããŒã¿æ§é ãå ã«ããããããæäœããããã® GUI ãåããå®è£ ã Inkscape ã§ãããšèãããšãã£ãããããããŠãŒã¶ã€ã³ã¿ãŒãã§ãŒã¹ãåççã§ãããšããããšã«æ°ä»ãããŸããæåã®å°è±¡ããããã£ãšå€ãã®å Žé¢ã§äœ¿ãããšããããšãçºèŠããã
æšæºä¿ååœ¢åŒ Inkscape SVG
Inkscape ã®æšæºçãªä¿å圢åŒïŒInkscape SVGïŒã¯ããããžããã¥ãŒããªãã®ã§ããã
Inkscape ã®æšæºçãªä¿å圢åŒã¯ãSVG ã§ãããããããããã¯ä¿åããããã¡ã€ã«ãã SVG ã®èŠæ Œã«å®ããããŠãããšã¬ã¡ã³ãã ããæŸã£ãŠèªãã§ãæåŸ ããéãã«ã©ã¹ã¿ã©ã€ãºã§ãããšããæå³ã§ãããå®éã«ã¯ç¬èªã«å®çŸ©ãããšã¬ã¡ã³ããå«ãã§ããããå±æ§ãè¿œå ãããŠããããããã®è¿œå ããããšã¬ã¡ã³ããå±æ§ã¯ããã£ã±ã Inkscape ã® GUI ã䜿ãåæããããã®ã«ããããã«çšããããŠããã
ããšãã°ãInkscape ã§å㯠circle ãšã¬ã¡ã³ãã§ã¯ãªããpath ãšã¬ã¡ã³ããšããŠäœæãããããã® path ãšã¬ã¡ã³ãã¯ãå匧æ²ç·ãæãããã® M ã³ãã³ãã 1 åãA ã³ãã³ãã 2 åçšããïŒç·åãŸã¯ãæäœéšåïŒã
<path sodipodi:type="arc" style="opacity:1;fill:none;fill-opacity:1; fill-rule:evenodd;stroke:#000000;stroke-width:1; stroke-linecap:round;stroke-miterlimit:4; stroke-dasharray:none;stroke-dashoffset:0; stroke-opacity:1" id="path7567" sodipodi:cx="-17.172863" sodipodi:cy="236.15866" sodipodi:rx="125.25864" sodipodi:ry="125.25864" d="M 108.08577 236.15866 A 125.25864 125.25864 0 1 1 -142.4315,236.15866 A 125.25864 125.25864 0 1 1 108.08577 236.15866 z" />
ïŒM ã³ãã³ãã¯çŸåšäœçœ®ã移åãããA ã³ãã³ãã¯ãçŸåšç¹ãå§ç¹ãšããããã§ãçµç¹ãå®ããããããçµã¶æ¥åã®åŒ§ãæãããããæãããã«ãæ¥åã®äºã€ã®ååŸãå匧ãæ¥åã®ã©ã®éšåããåãåã£ãŠäœ¿ãã®ãã瀺ãè§åºŠïŒãããã¯ãæ¥åãå転ãããè§åºŠïŒãå³ãŸããã«è¡ããå·ŠãŸããã«è¡ããã瀺ããã©ã°ãé·ãã»ãã®åŒ§ã䜿ããçãã»ãã®åŒ§ã䜿ããã瀺ããã©ã°ããšããæ å ±ãçšãããé¢çœãããšã«ãæ¥åã®äºã€ã®äžå¿ïŒåãªãã°ãããã¯åãç¹ã«ãªãïŒã®åº§æšããŒã¿ã¯äœ¿ãããªããïŒ
ã ããInkscape SVG ã¯ããã®åãç¹å®ããããã«å¿ èŠãªæ å ±ããã£ããããäžçµã¿ä¿æããŠããïŒèµ€åãŸãã¯å€ªåéšåïŒãããã¯ãæ¥åã®äžå¿ãšäºã€ã®ååŸãæã£ãŠããã
å®éã« Inkscape ã䜿ã£ãŠã¿ãŠãããããšã¯ãInkscape ã¯ãã¡ã€ã«ã®èªã¿èŸŒã¿æã«åŸè ã®æ å ±ãå©çšããŠããŠãåè ã®æ å ±ã¯ããã«ä¿åæã«ãã¡ã€ã«ã SVG ãšããŠãèªããããã«ä»å ãããŠããããããšããããšã§ããã
Inkscape ã¯ç¬èªã®ãšã¬ã¡ã³ãå®çŸ©ãå±æ§å®çŸ©ã䜿ãããã«ãæäžäœã«ããã svg ãšã¬ã¡ã³ãã®äžã§åå空éãè¿œå ããŠããã
<!-- Plain SVG ã§ä¿åããå Žåã®åå空é --> xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
<!-- Inkscape SVG ã§ä¿åããå Žåã®åå空é --> xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns å±æ§ã¯ XMLåå空éãèå¥ããããã«çšãããããInkscape ã¯ãã®å±æ§ãå³æ Œã«ãã§ãã¯ããã®ã§ãææžããã SVG ãã¡ã€ã«ã Inkscape ã§èªã¿èŸŒããããªå Žåã«ã¯æ³šæãå¿ èŠãšãªãã
SVG ã§ããã©ã«ãã®åå空é㯠http://www.w3.org/2000/svg ã§ãããããããåå空éã®å®£èšã xmlns="http://www.w3.org/2000/svg" ã ãã§æžããšã¯éããªã
ããšãã°ãuse ãšã¬ã¡ã³ããçšããŠããã¹ãåå©çšãããããªå Žåã href ãšããå±æ§ã䜿ããä»ã®éšåã§ãã§ã«å®çŸ©ãããã¹ãåŒçšããïŒãã®ä»çµã¿ã¯ Inkscape ã® GUI ã€ã³ã¿ãŒãã§ãŒã¹ã§ãã¯ããŒã³ããšåŒã°ããŠããïŒãããããããã§ã® href ãšããå±æ§ã¯ããã©ã«ãã®åå空éã«ã¯ãªã http://www.w3.org/1999/xlink ãšããåå空éã«å±ããŠããã
ãã®ãããuse ãšã¬ã¡ã³ããããããäžäœã®ãšã¬ã¡ã³ãã§ïŒãããã㯠svg ãšã¬ã¡ã³ãã§ïŒxmlns:xlink="http://www.w3.org/1999/xlink" ã®ããã«åå空éã®æ¥é èŸã宣èšããŠãããuse ãšã¬ã¡ã³ãã®äžã§ã¯ xlink:href="#g2115" ã®ããã«çšããå¿ èŠãããã
Inkscape ã®æ¡åŒµã¹ã¯ãªãã
Inkscape ã¯ã¹ã¯ãªãããæžããŠããããšã«ããã容æã«æ¡åŒµã§ãããã¹ã¯ãªããã¯ãèµ·åãããã¿ã€ãã³ã°ã«ããäžã€ã«åé¡ã§ããã
(A) ãã¡ã€ã«ãèªã¿èŸŒããšã
(B) ãã¡ã€ã«ãæžãåºããšã
(C) ç·šéäž
äžã§ãã (A) (B) ã®å Žåããã¡ã€ã«ãéãïŒä¿åããæã«ãã¡ã€ã«ã¿ã€ãã®å€å¥ïŒéžæã«ããèµ·åãããã®ã§ããŠãŒã¶ã¯ãããå€éšã¹ã¯ãªããã§ããããšã«æ°ä»ããªããããããªãïŒãšããããæ°ä»ããªããããµã€ãïŒããã Inkscape ãã©ããããã¡ã€ã«åœ¢åŒãèªã¿ïŒæžãã§ããã®ãã«é¢å¿ãããã®ãªãããã®çš®é¡ã®ãšã¯ã¹ãã³ã·ã§ã³ãäœãããŠãããïŒããšãã°ãã©ããªå€éšããã°ã©ã ã«äžè«ãã«åºããŠãããïŒãç¥ã£ãŠããå¿ èŠãããããããã® (C)ã¯ã¡ãã¥ãŒã«çŸããã®ã§ãããã«ãããšãããã
ãšã¯ã¹ãã³ã·ã§ã³ãå®çŸæ段ã«ããåé¡ãããšã
(ç²) C ã C++ ã«ããå
éšçãªæ¹æ³ããããããã€ãã£ãã§å¯Ÿå¿ããŠãããšèããããŠãããã®ã¯ãããã䜿ã£ãŠããããã§ãããããæå³ã§ã¯äžè¬ã«ãšã¯ã¹ãã³ã·ã§ã³ãšèããããŠãããã®ãšã¯éãããªã
(ä¹) SVG ãæšæºå
¥åããåãåããããã㪠SVG ãæšæºåºåã«åºåããããªåœ¢ã§æžãã¹ã¯ãªããåãã®ããæ¹ãããã¯ãã©ããªèšèªã§æžããŠãããŸããªããPython ãå€ã䜿ãããŠããã®ã¯ãxml ã®åŠçã«äœ¿ãããããšããçç±ã ãã ããã
(äž) XSLT ã«ããæ¹æ³
(äž) DOM ã«ããæ¹æ³
ãããã
åèãhttp://wiki.inkscape.org/wiki/index.php/ExtensionArchitecture#Functionality_Provided
以äžãäžèš (C)-(ä¹) ã®ã»ã³ã«æ²¿ã£ãŠãInkscape ã®æ¡åŒµããã詳ããèŠãã
inx ãã¡ã€ã«
ããããæžãã¹ããã®ã¯ãxxx.inx ãšããèšå®ãã¡ã€ã«ãšãæ¬äœã®ã¹ã¯ãªããã®äºã€ã§ããããããã¯ãããã®ç°å¢ã§ã¯ /usr/share/inkscape/extensions ãã£ã¬ã¯ããªã«çœ®ããŠãããInkscape ã¯èµ·åæã« xxx.inx ãã¡ã€ã«ãèŠã€ãåºããŠããšã¯ã¹ãã³ã·ã§ã³åãã¡ãã¥ãŒã«ç»é²ãããinx ãã¡ã€ã«ã«ã¯ãæ¬äœã¹ã¯ãªããã®å ŽæãããŠãŒã¶ãªãã·ã§ã³ãåãåãããããã®ãã€ã¢ãã°ãªã©ãå®çŸ©ããŠããã
ã¹ã¯ãªããèµ·åãŸã§
ãŠãŒã¶ããæ¡åŒµæ©èœãåŒã³åºããããšãInkscape ã¯ããããã®æ¡åŒµæ©èœã«å¯Ÿå¿ãã inx ãã¡ã€ã«ãèªããããã«ããããŠãŒã¶ãããªãã·ã§ã³ã®å€ãåŸãå¿ èŠããããã©ãããç¥ããå¿ èŠãããã°ãã€ã¢ãã°ãåºããå€ãç²åŸããã
ã€ãã«ãinx ãã¡ã€ã«ã«æå®ãããŠãã SVG åŠççšã®ã¹ã¯ãªãããèµ·åãããã€ãçµç±ã§çŸåšã® SVG ãã¡ã€ã«ã®å 容ãæšæºå ¥åã«æµã蟌ãããã®ãšããéžæãããç¶æ ã«ãã SVG ãªããžã§ã¯ãã® id ãšããã€ã¢ãã°ããã¯ã¹ã«ããç²åŸãããªãã·ã§ã³åãšå€ãã--opt1 value1 --opt2 value2 ã®åœ¢ã§ãã³ãã³ãã©ã€ã³ãªãã·ã§ã³ãšããŠã¹ã¯ãªããã«æž¡ãããã
ã¹ã¯ãªããã¯ãæçµçã«æžãæãããã SVG ãæšæºåºåã«åºåããInkscape ã¯ããã§ãããã¡ãæžãæããã
ã ãããã³ãã³ãã©ã€ã³ã§
$ cat old.svg | python script.py --id xxx --id xxx --your_opt xxx > new.svg
ãªã©ãšããããšã«ãã£ãŠãSVG åŠççšã¹ã¯ãªããã®ãããã°ãå¯èœã§ãããäžã¯ Pythn ã®äŸã ããPerl ã§ãã·ã§ã«ã»ã¹ã¯ãªããã§ããããŸã§ã¯åãã§ããã
Python ã«ããå žåçãªæ¡åŒµã¹ã¯ãªããââå šäœã®æµã
Inkscape ã«ã¯ãinkex.py ãšãã Python ã®ã¢ãžã¥ãŒã«ãä»å±ããŠããããšã¯ã¹ãã³ã·ã§ã³ã®å€ãããããå©çšããŠããããããå©çšããã¹ã¯ãªããã«ããã倧ãŸããªæµããèŠãã
ã¹ã¯ãªããã¯æåã«ãinkex ã¢ãžã¥ãŒã«ãèªã¿èŸŒã¿ãããã«å®çŸ©ããã Effect ã¯ã©ã¹ãç¶æ¿ããæ°ããªã¯ã©ã¹ãå®çŸ©ããïŒä»¥äžãããããã®ã¯ã©ã¹ããšããïŒãã¹ã¯ãªãããå®è¡ããããšãã®ã€ã³ã¹ã¿ã³ã¹ãäœæããïŒä»¥äžããããã®ã€ã³ã¹ã¿ã³ã¹ãïŒãã€ã¥ããŠããã®ã€ã³ã¹ã¿ã³ã¹ã® affect ã¡ãœãããåŒã³åºãããã¹ã¯ãªãããçµäºãããããããã¹ãŠã§ããã以äžããã®éçšã§èµ·ããããšã挞ã ãã©ã£ãŠã¿ãã
ãããã®ã€ã³ã¹ã¿ã³ã¹ã®åæå
inkex ã¢ãžã¥ãŒã«ã¯ãã³ãã³ãã©ã€ã³ãªãã·ã§ã³ã®åãåãã®ããã«ãoptparse ã¢ãžã¥ãŒã«ïŒåèïŒãã€ã³ããŒãããŠãããããã¯ãªãã·ã§ã³è§£æã®ããã®ã©ã€ãã©ãªã§ãEffect ã¯ã©ã¹ã¯ããã䜿ã£ãŠæ¬¡ã®ããã«ã³ãã³ãã©ã€ã³ã»ãªãã·ã§ã³ãåŠçããã
(ã¢) ãŸããOptionParser ã¯ã©ã¹ã®ã€ã³ã¹ã¿ã³ã¹ãäœæããã
(ã€)次ã«ãã®ã€ã³ã¹ã¿ã³ã¹ã«å¯Ÿã㊠add_option ã¡ãœãããé©çšããŠãæåŸ
ããããªãã·ã§ã³ã®ååãæã蟌ãã
(ãŠ) sys.argv[1:] ã§ã³ãã³ãã©ã€ã³ãªãã·ã§ã³ããªã¹ãã«ãããã®ãåŸãŠããããåŒæ°ã«ã㊠parser.parse_args ã¡ãœãããåŒã³åºãããã㯠{ãªãã·ã§ã³å:å€,...} ãšããèŸæžãšããªãã·ã§ã³åãæããªãåºå®ãªãã·ã§ã³ã®ãªã¹ããè¿ãã
(ã¢)ãš(ã€)ã Effect ã¯ã©ã¹ã® __init__ ã«å®çŸ©ãããŠããã(ãŠ)ã effect ã¯ã©ã¹ã® getoptions ã¡ãœããã«ããè¡ãããã
ãã ããEffect ã¯ã©ã¹ãå®çŸ©ããŠãã __init__ ã§ã¯ã--id ãªãã·ã§ã³ã«å¯ŸããæºåïŒadd_optionïŒããè¡ããªãããããã£ãŠãä»ã®ãªãã·ã§ã³ãåãåãããã®ãªãããããã®ã¯ã©ã¹ã§ã __init__ ã¡ãœãããäžæžãã§å®çŸ©ããŠããå¿ èŠãããã
ããšãã°ãinx ãã¡ã€ã«ã«æžããããŠãŒã¶ãžã®åãåããã
<param name="mynumber" type="int" min="0" max="100" _gui-text="Number which you like.">7</param>
ãšå®çŸ©ãããŠãããªãã°ãMyClass ã¯ã
class MyClass(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) self.OptionParser.add_option("--mynumber", action="store", type="int", dest="mynum", default=7, help="Numbe which we like")
ã®ããã«ãªãã ããããªããå€ãè€æ°äžŠã¹ãããããšãäºæ³ããŠããå Žåã¯ãadd_option ã®åŒæ°äžã§ãaction="append" ã«ããŠãdefault=[] ãªã©ã«ããã°ããã
affect ã¡ãœããã®ä»äº
Effect ã¯ã©ã¹ã«å®çŸ©ãããŠãã affect ã¡ãœããã¯æ¬¡ã®ãããªé çªã§ä»äºãããã
(1) ã³ãã³ãã©ã€ã³ãããªãã·ã§ã³ãåãåã解æã㊠self.options ã«åããæ®ãã®åºå®åŒæ°ã self.args ã« åããã
(2) æšæºå
¥åããåŸã SVG ãããŒã¹ã self.document ã«åãããããã¯ãxml.etree.ElementTree.ElementTree ã¯ã©ã¹ïŒåèïŒã®ã€ã³ã¹ã¿ã³ã¹ã§ããã
(3) ã«ã¬ã³ãã¬ã€ã€ãŒãåŸãããšè©Šã¿ã«ã¬ã³ãã¬ã€ã€ãŒãããã°ãã®ååã self.layername ã«åããã¬ã€ã€ãŒïŒå®äœã¯ã°ã«ãŒãã»ãªããžã§ã¯ãïŒã self.layer ã«åãããã«ã¬ã³ãã¬ã€ã€ãŒããªããã°ãã«ãŒãã self.layer ã«åããã
(4) éžæãããç¶æ
ã«ããããŒããåéã㊠self.selected èŸæžã« id ãããŒãšããŠåãããïŒããã§ã¯ãããŒãããšãã£ãŠããSVG ã® path ã®ã³ã³ãããŒã«ãã€ã³ãã®ããšã§ã¯ãªããSVG ãããªãŒæ§é ãšããŠèŠããšãã®ããŒãã®ããšã§ãããSVG ã®åãªããžã§ã¯ãã®ããšã§ãããã€ãã§ãªãããããšãInkscape ã¯ãéžæäžã®ã³ã³ãããŒã«ãã€ã³ããæ¡åŒµã¹ã¯ãªããã«ç¥ãããæ段ãæã£ãŠããªãããã ïŒ
(5) ããã¥ã¡ã³ãäžã®ãã¹ãŠã® id ãããŒãšããèŸæž doc_ids ãã€ãããå€ããã¹ãŠ 1 ã«ã»ããããããªã¹ããããªããŠèŸæžã䜿ãã®ã¯ãã£ãšäžææ§ã®ä¿èšŒã®ãããªãã ãããå€ã¯ãŸãã©ãã§ãããããã ãã
(6) self.effect ã¡ãœãããå®è¡ããããã®ã¡ãœããã®äžèº«ã¯äœããªãã
(7) SVG ãæšæºåºåã«åãåºãã
å®éã« SVG ã«å€æŽãå ããã®ã¯ (6) ã® effect ã¡ãœããã§ããããEffect ã¯ã©ã¹ã§ãã®å®çŸ©ã¯ç©ºã«ãªã£ãŠããããšããããåèªããããç¶æ¿ããã¯ã©ã¹ã«ãããŠäžæžãããŠå®çŸ©ããããšãæåŸ ãããŠããã®ã§ããã
ãããã£ãŠãããããã¯ã(1),(3)ã(5) ãŸã§ã«ãããŠåŸãããããŸããŸãª SVG ã®ãªããžã§ã¯ããæãããã« (2) ã§åŸããã self.document ã«å€æŽãå ãããã㪠effect ã¡ãœããããå®çŸ©ããã°ãããšããããšã«ãªãããããã ElementTree ã¯ã©ã¹ã«å¯ŸããæäœïŒåèïŒããããããšäœ¿ãããšã«ãªãã ããã
ããŸãââé·æ¹åœ¢ãåãã·ã§ã¢ã«ããåå²ãã Inkscape ã®æ¡åŒµã¹ã¯ãªãã
é·æ¹åœ¢ãã垯ã°ã©ãããåããåã°ã©ããäœæããæ¡åŒµã¹ã¯ãªãããïŒUbuntu äžã§ Inkscape 0.46 ã䜿ã£ãŠè©Šããã ãïŒ
ã€ã³ã¹ããŒã« chart.inxãchart.py ã /usr/share/inkscape/extensions çã«æŸã蟌ãã§ãInkscape ãç«ã¡äžããã
䜿çšæ¹æ³
ïŒ1ïŒé·æ¹åœ¢ïŒãŸãã¯åïŒãšãæ°åã®ãªã¹ãã 1 è¡ã«æžããããã¹ãããçšæãããã®äž¡æ¹ãéžæã
ïŒ2ïŒãšãã§ã¯ãã»ã¡ãã¥ãŒã®ããã¹ãå€åœ¢ããã Chart ãéžæ
ããã¹ãã®æ°åã«ãããã£ãŠãã·ã§ã¢ã«åºã¥ãåå²ãããã
ããã¹ãäžã« % æåããããšãæ°åã¯ãã¹ãŠããŒã»ã³ããšè§£éãããæ®äœé ç®ãèªåçã«èšç®ãããã
ä»ã®ãã¡ã€ã«åœ¢åŒã®èªã¿æžã
Inkscape ã¯ãããŸããŸãªãã¡ã€ã«åœ¢åŒã®èªã¿æžããã§ãããããã®å€ãã¯å€éšããã°ã©ã ãå©çšã㊠SVG 圢åŒã«å€æããŠããã®ã§ããããŠãŒã¶ã¯ãããšæ°ä»ããã«å©çšããããšãã§ãããLinux ç°å¢ã®è©±ã§ããããWindows çã§ã dill çã® python ãªã©ãïŒãããïŒæšæºã§ã€ããŠããã®ã§ããããå©çšããŠããªãã®ããšãè¡ãããšæãããå®é確ãããŠãªããã
Adobe Illustrator 圢åŒ
èªã¿æžããšãå€éšãšã¯ã¹ãã³ã·ã§ã³ãå©çšã
èªã¿èŸŒã¿ïŒai_input.inx ã®æ瀺ã«ãããåŠçã perl ã®ã¹ã¯ãªããã§ãã ill2svg.pl ïŒInkscape ã«ã€ããŠããïŒã§è¡ããããããã¯ãã·ã§ã«ããã䜿ããç¬ç«ãããã®ã§ãå€éã«åŠçãããšãã«ã¯ãããããã§ãè©ŠããŠãªãã
æžãåºãã¯ãai_output.inx ã®æ瀺ã«ããåŠçã Ghostscript ã«ããè¡ããããã³ãã³ã㯠gs -q -dNODISPLAY -dSAFER ps2ai.ps
Adobe Illustrator ã® SVG
èªã¿èŸŒã¿ã¯ãã€ãã£ãã§å¯Ÿå¿ããã ãâŠâŠ
Illustrator ã®äººãäœã£ã SVG ã®ãµã€ãºãã²ã©ã倧ããã®ã§ããšãã£ã¿ã§éããŠã¿ãããããæªç¥ã®ãšã¬ã¡ã³ããããŠãäœããªãã ããããã¬ãæªç¥ã®åå空éãã©ã£ããå®çŸ©ãããŠããŠãããã©ã«ãã®åå空éã§ãããèŠãªããäŸã®ãã€ã§ã¯ãªãã
http://wiki.inkscape.org/wiki/index.php/FAQ#I_exported_an_SVG_file_from_Adobe_Illustrator.2C_edited_it_in_Inkscape.2C_and_imported_back_to_AI.2C_but_there_my_changes_are_lost.21
ïŒåèš³ããŠãã人ãã http://wikiwiki.jp/inkscape/?FAQ#uc6ab4c7ïŒ
ãŠãªé ãçºèŠãããããã«ã(1) Illustorator ãçæãã SVG ã¯ãSVG ãšããŠèªãããšãã§ãã (2) ããããç¬èªå®çŸ©ã®ãšã¬ã¡ã³ããè¿œå ããŠãIllustrator çšã®ãã€ããªããã£ããä¿æããŠããããšããã®ã ãã¡ãªã¿ã«ãIllustrator ã§ä¿åãããšãã«ãPreserve Adobe Illustrator Editing ãš Optimize for Adobe SVG viewer ã®ãã§ãã¯ãå€ãã°ããã®å€ªã£ã¡ããªåœ¢åŒã«ã¯ãªããªããããã
Inkscape ã«ã¯ XSLT 㧠Illustrator ãäœã£ãéã SVG æžé¡ããäžèŠãªéšåãåé€ããã¹ã¯ãªãããã€ããŠãããç§ã®ç°å¢ã§ã¯ã/usr/share/inkscape/extensions/aisvg.xslt ãšããã®ãããã ãããã¯ãã.ai.svgã ã§çµãããã¡ã€ã«åãèªã¿èŸŒããšãã«ãã£ã«ã¿ãŒãšããŠäœçšããããèšèšãããŠãããããããç§ã®ãšããã§ã¯ããã¡ã€ã«åããã®ããã«å€ããŠãæ©èœããªãã£ããïŒâ»ãã㯠Inkscape 0.46 ã§äœ¿ããããã«ãªã£ããããããªãªãŒã¹ããŒãã« This is used to support the XAML file format (both import and export) and the Adobe Illustrator SVG import which removes Adobe's stuff from SVG. ãšããïŒïŒäœè«ïŒãã® inx ãã¡ã€ã«ã®Description ã«ãããšããAdobe Illustrator SVGs ãéãåã« cruft ãåé€ããããšæžããŠãããcruft ããªãŒããŒãºïŒç¬¬ 2 çïŒã§åŒããšãããããªãã®; ç²æ«ãªäœãã®çµæããšãããïŒ
http://wiki.inkscape.org/wiki/index.php/ExtensionArchitecture#Implementation_Types ã«ãããšãXSLT ããã»ããµã«ã¯ libxml ã®ãã€ããªã³ã¯ããŠäœ¿ã£ãŠããããã ããI am not aware of the status of the XSLT implementation. ãšãã£ããæžããŠãããããæªå®è£ ãªã®ããªããå®éã«ãã£ãŠã¿ããã©åããªãã£ãããä»æ¹ãªããããèªåã® xsltproc ã§ã
$ xsltproc aisvg.xslt large_ai_file.svg > modest_one.svg
ãªã©ãšãã£ãŠãã£ãããããšãã° 1.9M ãããã¡ã€ã«ã 602 KB ã«ãªã£ãã
Plain SVG
W3C ãå®çŸ©ããŠãããšã¬ã¡ã³ããå±æ§ã ãã SVG æžé¡ã ãïŒã¡ãã£ãšäŸå€ããïŒã䜿ã£ã圢åŒããInkscape ã§ã¯ãPlain SVG ãšåŒãã§ãããã©ã«ãã® Inkscape SVG ãšåºå¥ããŠãããèªã¿èŸŒã¿ãæžãåºããšããã€ãã£ãã§å¯Ÿå¿ã
Inkscape SVG ãèªã¿èŸŒãã§ãPlain SVG ã§ä¿åãçŽããšããããã®æ å ±ãèœãšãããŠããã¡ã€ã«ãµã€ãºã¯å°ãããªãããã ãããšãã°ãAdobe Illustrator ã§äœæãã SVG ãèªã¿èŸŒãã§ãPlain SVG ã§ä¿åããŠããµã€ãºã¯ïŒã»ãšãã©ïŒå€ãããªããäºæ³ããŠããªãåå空éã«å±ãããšã¬ã¡ã³ããå±æ§ã¯ Plain SVG ã§ä¿åãããšãã«ããã£ããæ®ããŠãããŠå®å šãå³ã£ãŠãããããã
以äžã¯ãæ¥é èŸã®ãªããšã¬ã¡ã³ããšãæ¥é èŸã svg ã®ãšã¬ã¡ã³ã以å€ããã¹ãŠåé€ããŠããŠç¡çãã Plain SVG ã£ãœããã®ã«ãã XSLT ã¹ã¯ãªãããïŒå±æ§ã®ã»ãã«ã¯æã觊ããªããïŒãªããAdobe Illustrator ã® SVG ã®æžéã«ã€ããŠã¯ãæåãã Inkscape ã«ããŸã XSLT ã¹ã¯ãªãããã€ããŠããã
<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" > <xsl:output method="xml" indent="no" /> <xsl:template match="/"> <xsl:apply-templates select="svg:svg" /> </xsl:template> <xsl:template match="@*|svg:*"> <xsl:copy> <xsl:apply-templates select="@*|svg:*" /> </xsl:copy> </xsl:template> </xsl:stylesheet>
åè
http://www.w3.org/TR/1999/REC-xslt-19991116#copying
ïŒåéŠèš³ http://www.infoteria.com/jp/contents/xml-data/REC-xslt-19991116-jpn.htm#copyingïŒ
http://www.asahi-net.or.jp/~ps8a-okzk/xml/xslt10_1/copying.html ã®äœ¿çšäŸ
ããšãã°ãããã»ããµã« xsltproc ã䜿ããªãã
$ xsltproc script.xsl old.svg > new.svg
ãŠãªæãã§ãããŸããããã©ããä¿èšŒã®éãã«ãããã
Postscript
æžãåºãã¯ãã€ãã£ãã§å¯Ÿå¿ã
èªã¿èŸŒã¿ã¯å€éšãšã¯ã¹ãã³ã·ã§ã³ãå©çšãããããã«ããPostscript --(pstoedit)--> sketch,skencil åœ¢åŒ --(skconvert.py)--> SVG 圢åŒããšããããšã§ããªãInkscape ã Postscript ãèªã¿èŸŒããªããããªããpstoedit ãš skencil ãã€ã³ã¹ããŒã«ãããšããããšã§ãã现ããèŠãŠãããšâŠâŠ
ps_input.inx ã®æ瀺ã«ãã pstoedit -f sk ãå®è¡ãsk ãšããã®ã¯ãSketch Format ã®ããšãScketch Format ãšã¯ã以å sketch ãšç§°ãããã skencil ãšãããããŒã€ã³ã°ã»ããã°ã©ã ã§äœ¿ã圢åŒã®ããšã次ã«ãps_input.inx ã¯ããã® Scketch Format ã sk_input.inx ãšãã inx ãã¡ã€ã«ã«ä»»ããããã® inx ãã¡ã€ã«ã¯ãsk2svg.sh ãšããã·ã§ã«ã¹ã¯ãªãããèµ·åããã㯠skconvert ãšããããã°ã©ã ãèµ·åãããããã® skconvert ãšããã®ã¯ skconvert.py ãšãã python ã®ã¹ã¯ãªããã§ãsckencil ãã€ã³ã¹ããŒã«ãããšåæã«ã€ã³ã¹ããŒã«ããããã®ãããã«ãã£ãŠ SVG ãã¡ã€ã«ã«å€æããããããŒããã©ãã
Dia 圢åŒ
Dia ãšããã®ã¯ããã€ã¢ã°ã©ã ãšãã£ã¿ããããŒãã£ãŒããªããæžãã®ã楜ãªãã€ãInkscape ã«ãã³ãã¯ã¿ãšããã®ãããããDia ã®ã»ããç¹åããŠããã®ã§ããå Žåãããã
èªã¿èŸŒã¿ã¯ dia.inx ã dia2svg.sh ã«ä»»ãããdia2svg.sh ã¯ããªãã®ããšã¯ãªã Dia ãèµ·åã㊠SVG ã§ä¿åããã ãã®ãã®ãæåãã Dia 㧠SVG ä¿åããã®ãšäœãå€ããããšãªãã
æžã蟌ã¿ã¯ã§ããªãã
DXF 圢åŒ
CAD ã䜿ããã¡ã€ã«åœ¢åŒã ããã ããç§ã«ã¯æªç¥ã®ãã©ãŒãããã
èªã¿èŸŒã¿ã¯ dxf_input.inx ã dxf2svg ãšããããã°ã©ã ã«äžè«ãã«åºãããã®ããã°ã©ã ã®æ£äœã¯ç§ã«ã¯äžæã
æžãåºã㯠dxf_output.inx ã«æ瀺ãæžããŠãã£ãŠããŸã Postscript ã§åºåããŠãããps2dxf.sh ãšãã Inkscape ä»å±ã®ã·ã§ã«ã»ã¹ã¯ãªããã䜿ãããã®ã·ã§ã«ã»ã¹ã¯ãªãã㯠pstoedit -f dxf ãããã ãã®ãã®ã
æžãåºãããããã®ã«ããäžã€ãã£ãŠãdxf_outlines.inx ã dxf_outlines.py ãšãã Inkscape ã«ã€ããŠããããã°ã©ã ãèµ·åããããäœãªã®ãã¯ãç§ã«ã¯ãã£ã±ãããããªãã
ãã®ä»
ãŸã ãŸã ãããããããããŸãã®æ©äŒã«ã
åäœã®ããš
ã©ããããã¯ã»ã«ãšããåäœãæ°æã¡æªãã®ã§ãã¡ã¢ãäœæããŠæŽçãïŒç§ã®èª€è§£ãè¡éº»åãã誀解ãçãè¡šçŸãªã©ã«æºã¡ãŠããã¯ããæ£ããæ å ±ã¯ SVG ãš CSS2 ã®ä»æ§æžããåŸãŠé ãããåãåïŒ
ãŸãããããåã®è©±
ãã¯ã»ã«ãšã¯ãäžè¬ã«åºåããã€ã¹ãäœãããæå°éã®ãŠããããšããããšã«ãªã£ãŠããããã§ãããã€ãŸããããã¯ãç©ãã§ãããäžåäºåãšæ°ãããã®ã§ãããäžæ¹ããã®ãç©ãã®äžèŸºã®é·ããäžåäœãšããŠãé·ãã枬ãããšãè¡ãããããããââãã¯ã»ã«ãšè¡šçŸãããã®å Žåã¯ãã¯ã»ã«ã¯ãç©ãã§ã¯ãªããé·ãã®åäœã§ããããšãããã1 ãã¯ã»ã«ãäœããªã¡ãŒãã«ã«ããããã¯ãåºåããã€ã¹ã«äŸåããããŸããåºåããã€ã¹ã®è§£å床ãªã©ãè¡šçŸããããã«ã1 ã€ã³ããããã«ããã€ã®ãã¯ã»ã«ãå ¥ãããšããè¡šçŸãè¡ããããdpi ãšããã®ãããã§ããããã㧠dpi ãæ¢ç¥ã§ããã°ããã¯ã»ã«ãããã€ã€ãªããé·ãã§ãããã«ãã£ãŠãåºåããã€ã¹ã«äŸåããªã絶察çãªé·ããè¡šçŸããããšãã§ããã90 dpi 㧠90 ãã¯ã»ã«ã®é·ããšããã°ã1 ã€ã³ããšããã®ãšåãã§ããããã®ããã« dpi ãšãã¯ã»ã«æ°ã§é·ããè¡šçŸãããšããã®ã¯ãåºãè¡ãããŠããã
Inkscape ã®ä»æ§ã¯è³ªçŽ ã
ç§ã®ç°å¢ã® Inkscape ã¯ã1/90 ã€ã³ãã 1 ãã¯ã»ã«ãšå®çŸ©ãããããããã©ã«ãã®åäœãšããŠããïŒãã«ãã«ãã£ãŠãããç°ãªãã®ãã©ãããç§ã¯ç¥ããªãã®ã§ã以äžèªã¿æ¿ããå¿ èŠããããããããªãïŒããã®é¢ä¿ã¯ Inkscape ã§ã¯åžžã«äžå®ã§ãããèšå®ãçŽãããšã¯ã§ããªããããã¯ã人æ°ãã€ã³ãã£ã³ã°ã»ããŒã«ã® Gimp ã§ãé·ãã®åäœã§ãããã¯ã»ã«ãšã€ã³ãã®é¢ä¿ãèªç±ã«èšå®ããããšãã§ããã®ã«æ¯ã¹ãŠãäžèŠè³ªçŽ ãªä»æ§ã®ããã«èŠããã
CSS2 ã«ãããã¯ã»ã«
ãŸããInkscape 㯠SVG æºæ ã§ããããã® SVG ã«ã¯ãã¯ã»ã«ãšãããšã㯠CSS2 ã®å®çŸ©ã«ãããšãããCSS2 ã§ã¯ããã¯ã»ã«ãåºåããã€ã¹ã®è§£å床ã«äŸåããªãåäœãšããŠå®çŸ©ããåºåããã€ã¹ã®æå°åäœãšããŠã®ãã¯ã»ã«ã®ã»ãã¯ãããã€ã¹ã»ãã¯ã»ã«ãšåŒãã§ãããåºå¥ããŠããã
ã§ã¯ãCSS2 ã§ã¯ 1/90 ã€ã³ãã 1 ãã¯ã»ã«ã®é·ããšå®çŸ©ããŠããã®ããšãããšãããåçŽãªãã®ã§ã¯ãªããCSS2 㯠1 ãã¯ã»ã«ãã90 dpi ã®è§£å床ããã€åºåã«ããã 1 ããã€ã¹ã»ãã¯ã»ã«ã 28 ã€ã³ãé¢ãããšããããèŠãã®ãšåãèŠè§ã«ãªãé·ãããšå®çŸ©ããŠããã
èŠè§ãšã¯äœãã
èŠè§ïŒvisual angleïŒãšããã®ã¯ã察象ã®ç«¯ãã端ãŸã§ãèŠãè ã«ãšã£ãŠã©ã®ãããã®è§åºŠã®äžã«ãããŸã£ãŠèŠããããšããããšã§ãããã¯å¯Ÿè±¡ã®å€§ãããšå¯Ÿè±¡ãŸã§ã®è·é¢ã«äŸåããã
察象ã®å€§ããã察象ãŸã§ã®è·é¢ãšèŠè§ã®é¢ä¿ã¯
èŠè§ = 2 arctan (察象ã®å€§ãã / 2 / 察象ãŸã§ã®è·é¢)
ã®ããã«ãªããïŒå³ã«æããšåçŽãªããšãªãã ããé£ãããã«èŠãããïŒ
28 ã€ã³ãé¢ãããšããããã1/90 dpi ã®åºåããã€ã¹ã«ãã 1 ããã€ã¹ã»ãã¯ã»ã«ãçºãããšãèŠè§ã¯çŽ 0.0277 床ã§ãããã€ãŸããããã CSS2 ã®ãã¯ã»ã«ã®æ£äœã ã
ïŒããã§ã现ããããã³ãããããŠãããCSS2 ã®èŠæ Œã§ã¯ 1 ãã¯ã»ã«ã®é·ããå®ããŠãããã 10 åéãŸã£ãã 10 ãã¯ã»ã«ãšããããšã«ãªã£ãŠããã®ã§ãã£ãŠã10 ãã¯ã»ã«ã®èŠè§ã 1 ãã¯ã»ã«ã® 10 åã®èŠè§ã ãšèšã£ãŠããã®ã§ã¯ãªãããããåŸè ã®ãããªå®çŸ©ã§ãã£ããªãã°ãèŠçã®åšèŸºéšã§ã¯ 1 ãã¯ã»ã«ã®çµ¶å¯Ÿçãªé·ããã²ã©ã倧ããªãã®ã«ãªã£ãŠããŸãããã¯ã»ã«ãšããªã¡ãŒãã«ã®å€æãªããŠã§ãããããããªããããã¯ããã§ããã©ãã¿ãªãŠã åãã®èŠæ Œãããããªããã©ãïŒ
ãããã«ãå°çãã倪éœãèŠããšãäœãã¯ã»ã«ã«ãªããèšç®ããŠã¿ãããå°çãã倪éœãŸã§ã®è·é¢ã¯ããã 1 å 4900 äž Km ã§ããããã®è·é¢ã«ããã 1 ãã¯ã»ã«ã®å€§ããã¯ã7 å 2034 Km ã§ããã倪éœã®å€§ãã㯠139 äž Km ã§ãããããããã¯ çŽ 19.2 ãã¯ã»ã«ã«ãããããšã«ãªãã
ãµããã³ Inkscape ã®ããš
ãããããããªã®ã§ãInkscape 㧠1 ãã¯ã»ã«ã 1/90 ã€ã³ãã«åºå®ãããŠããŠããã€ãInkscape ã CSS2 ã«æºæ ããŠãããšããããšã¯ãç®ãšåºåã®è·é¢ã« 28 ã€ã³ããæ³å®ãããŠããããšãæå³ããŠãããšãèšããã
ãªããã1 ãã¯ã»ã« ïŒ 1/90 ã€ã³ãããšããã®ã¯ãInkscape ã®ãã£ã¹ãã¬ã€äžã®è¡šç€ºã«ããå°å·ã®å Žåã«ãçšããããããã£ãšãããã£ã¹ãã¬ã€ç»é¢ã®å Žåã¯ãïŒãã©ããããŒã ã«ãã£ãŠéãããã§ã¯ããããç§ã®ãšããã§ã¯ïŒè§£å床㫠90 dpi ã®ãã£ã¹ãã¬ã€è£ 眮ãæ³å®ããŠããŠãç§ã® 85 dpi ã®ãã£ã¹ãã¬ã€è£ 眮ã§ã¯å®éããè¥å¹²å€§ãã衚瀺ããããããªã³ã¿ã§å°å·ããå Žåã«ã¯ãããšãã°ãã€ã³ããªã©ã®çµ¶å¯Ÿçãªåäœã«æç®ããŠåœä»€ãéããªã©ããã®ã§ããã®é·ãã¯æ£ç¢ºã§ããã
ãã¯ã»ã«ã«ããé·ãæå®ã®åé¡
çäžïŒè£œçããããã®åçš¿ïŒãäœæãããããªå ŽåãCSS2 ã«å®ãããã¯ã»ã«ã§é·ããæå®ãããšå°ãããšã«ãªããCSS2 ã®ãã¯ã»ã«ã§è¡šçŸããããã®ã¯ãç®ããåºåç©ãŸã§ã®æ³å®ãããè·é¢ã«å¿ããŠåºåç©ã®ãµã€ãºãå€ãã£ãŠããŸãããã ãããããå Žåãããªã¡ãŒãã«ãã€ã³ããªã©ã®çµ¶å¯Ÿçãªé·ããè¡šããåäœãæãŸããã
ãšããã Inkscape ã§ã¯ãããã©ã«ãã®åäœããã¯ã»ã«ããããªã¡ãŒãã«ãã€ã³ãã«å€ããããšã¯ã§ããªãïŒãæ¬åœïŒãïŒãã©ããããã
ïŒãã€ã®ãšããCSS2 ãå®ãããã¯ã»ã«ãšããã®ã¯ãåºåããã€ã¹ã«åãããŠè¥å¹²ã®åºå ¥ããèš±ããã®ã§ããããããã®é¢ããããã¯ã»ã«ã®äœ¿çšã¯çäžäœæã«ã¯åããªããäžæ¹ã§ããã¯ã»ã«ã§æå®ããŠãããã»ããæå©ãªå Žåãããã解å床ã®äœãããã€ã¹ã§åºåããå Žåã«ã¯ãæŽæ°åã®ããã€ã¹ã»ãã¯ã»ã«ããŸãšã㊠CSS2 ã®ãã¯ã»ã«ãè¡šçŸããã»ããçŸãããåäœããã¯ã»ã«ã®ãŸãŸçšããŠããã° SVG ãèªã¿èŸŒãã ãŠãŒã¶ã»ãšãŒãžã§ã³ããåºåãçŸããèŠããããã«ããŸãæç®ããŠãããå¯èœæ§ããããCSS ã®ãã¯ã»ã«å®çŸ©ã«è¥å¹²ã®åºå ¥ããèš±ãããŠããã®ã¯ãã®ããã§ããïŒ
ãããã Inkscape ã®ããã©ã«ãåäœã¯æ¬åœã«ãã¯ã»ã«ãªã®ã
ãããªãå€ãªããšãèšãåºããªããInkscape ã«ãããŠããããŠãããæºæ ããŠãã SVG ã«ãããŠããŠãŒã¶ããçµµæããã空éã«ãããããã©ã«ãã®åäœã¯ãã¯ã»ã«ãªããã§ã¯ãªããããã¯æ¬åœã¯ããŠãŒã¶ãåæã«ãããããåäœã§ãã£ãŠãSVG ã§ã¯ããããŠãŒã¶ã»ãŠããããšåŒãã§ããã
ãŠãŒã¶ã»ãŠãããã§è¡šçŸããããŠãŒã¶ç©ºéã¯ãå°å·ãããé åãããã¥ãŒã»ããŒããšåŒã°ããç©åœ¢å ã«ååãããããã®ãšããåæïŒinitialïŒã®ç¶æ ã§ã¯ããŠãŒã¶ã»ãŠãããã¯ãã¯ã»ã«ã«çãããšä»®å®ããããã§ãã¥ãŒã»ããŒãã«ååãããããããããç°¡åã«ãããã©ã«ãã¯ãã¯ã»ã«ã§ããããšèšã£ãŠããããã§ããã
ãŸããããŠãŒã¶ãŠãããã¯ãã¯ã»ã«ã§ããããšããåæã®ä»®å®ããããŠãŒã¶ãŠãããã¯ããªã¡ãŒãã«ã§ããããšããã€ã³ãã§ããããšãã«ã¯å€æŽã§ããªãããã®ããšãç°¡åã«ããããã©ã«ãåäœãå€æŽããããšã¯ã§ããªãããšèšã£ãŠããã®ã§ããã
ããããããã¯ãããŸã§ãåæã®ä»®å®ã§ãããå®éã«ã¯ SVG ãèªã¿èŸŒãŸããåŸã«èµ·ããè€éãªéçšã«ãã£ãŠããŠãŒã¶ãŠãããã¯ããŸããŸã«è§£éãããããšã«ãªããå žåçã«ã¯ãSVG ãããäžäœã® SVG ã«åã蟌ãã å Žåã§ãäžäœã® SVG ãšã®äº€æžïŒããŽã·ãšãŒã·ã§ã³ïŒãèµ·ããããããå€æŽãããã
ãã¥ãŒã»ããã¯ã¹
SVG æžé¡ã®è£œäœè ã¯ãŠãŒã¶ç©ºéãã©ããã¥ãŒããŒãã«ååããããæ瀺çã«å®çŸ©ããŠããããšãå¯èœã§ããããã¥ãŒã»ããã¯ã¹ãšåŒã°ããç©åœ¢ãèšå®ãããšããŠãŒã¶ç©ºéãããã¥ãŒã»ããã¯ã¹ã§åãåãããç¯å²ããã¥ãŒã»ããŒãã«ãã£ããããããã«ååããããããã«ãããããã©ã«ãã®ååã®ããæ¹ãå€æŽããããšãã§ããã
ããšãã°ããã¥ãŒããŒãã®å€§ããã 210 mm à 297 mm (A4) ã®ãšãããã¥ãŒããã¯ã¹ã®å€§ããã 210 ãŠãŒã¶ãŠããã à 297 ãŠãŒã¶ãŠãããã«æå®ããŠããã°ããŠãŒã¶ç©ºéã«ããã 1 ãŠãŒã¶ãŠãããã¯ããã¥ãŒããŒãã«ããã 1 mm ã«ååãããã
ãã¥ãŒããã¯ã¹ãšãã¥ãŒããŒãã®çžŠæšªæ¯ãç°ãªãå Žåãåè ãåŸè ã«ãã£ãããããããæ¹ãããã€ãèãããããSVG ã§ã¯ãpreserveAspectRatio ãšåŒã°ããå±æ§ã svg ãšã¬ã¡ã³ãã«äžããããšã«ããããã£ããã®ä»æ¹ãã³ã³ãããŒã«ã§ããããšã«ãªã£ãŠããããã ããInkscape 0.43 ã§ã¯ãpreserveAspectRatio å±æ§ã¯ãµããŒããããŠããªããããã®å±æ§ãæå®ããªãã£ãå Žåã®åäœã SVG éãã«ã¯ãªã£ãŠããªãããã®ãããçŸåšã®ãšãããã¥ãŒããŒããšãã¥ãŒããã¯ã¹ã®ããããã®çžŠæšªæ¯ãå®å šã«çãããªãããã«ããŠããã®ãç¡é£ã§ãããã
ãã£ãšããWeb äžã§ç»åãå ¬éãããããªå Žåãæ£ç¢ºãªãµã€ãºããããŠãŒã¶ãšãŒãžã§ã³ãã®èšç®éã®åæžãåªå ãããã ããããããã¥ãŒããã¯ã¹ã䜿ããã«è¡šç€ºã§ããããã«ããã»ããããããã«æãããã
ãªãããInkscape ã® GUI ã¡ãã¥ãŒããã¯ãã¥ãŒããã¯ã¹ãå®çŸ©ããããšãã§ããªãããç·šéãã¡ãã¥ãŒãã XML ãšãã£ã¿ãåŒã£åŒµãåºããŠããŠææžãã§å ããå¿ èŠããããããã¯ãããã¯ãè€éãªç»åã®å Žåã«ãã¥ãŒããã¯ã¹ãäœã£ãŠããããšããçãããŠãŒã¶ãšãŒãžã§ã³ãã®è² æ å¢ãå«ã£ãŠãããšããããšãªã®ãããããªãã
äœè«ãªãããããäžè¬çãªäœ¿çšæ³ã«ãããŠãããã¥ãŒããã¯ã¹ãè¿œå ããŠãããšããå Žåãããããã¥ãŒããã¯ã¹ãäœæããŠãããšãã¡ãã¥ãŒãããçšçŽãµã€ãºããå€æŽããã ãã§ãèªåçã«äœç»å 容ãçšçŽã«ãã£ããããããã«æ¡å€§ãããããã ãããããããšã SVG ãã¡ã€ã«ã®åãåãæã®äŸ¿å®ã«ããªãããšãããã ãããããšãã°ããã®çœå°å³ã¯ïŒ¡ïŒå€ã ããInkscape ã§ãããéããGUI ã¡ãã¥ãŒã§çšçŽãµã€ãºãïŒã«å€æŽããã ãã§ããã®ãŸãŸïŒ¡ïŒå€ã®çœå°å³ãšããŠå©çšããããšãã§ããã
ãã§ããInkscape ã«ã¯åäœãèšå®ããã¡ãã¥ãŒããããã
å€åœ¢ããŒã«ïŒé»ç¢å°ïŒéžææã«ã¯ãããŒã«ã³ã³ãããŒã«ããŒã«éžæããããªããžã§ã¯ãã®äœçœ®ãšå€§ããã衚瀺ãããæ°åãå ¥åããããšãã§ããããã®å³åŽã«ããã¯ã»ã«ãããªã¡ãŒãã«ãªã©åäœãéžã¹ãã¡ãã¥ãŒãããã
ãã®ã¡ãã¥ãŒã§åäœãããªã¡ãŒãã«ã«ãããšããŠããå éšçã«ã¯çžå€ããããã¯ã»ã«ãçšããããŠããããããŠãä¿åãããã¡ã€ã«ãã®ãããŠã¿ãŠããåäœã¯ãã¯ã»ã«ã®ãŸãŸã§ãããããã¯ããŠãŒã¶ã€ã³ã¿ãŒãã§ãŒã¹ã®æ°é ããšãããã€ã§ããŠãŒã¶ã«ç€ºããšãã ãéžæãããåäœã«æç®ããæ°åãèŠããŠããã®ã§ããã
ã€ãã§ã«èšã£ãŠãããšããã®æ¬ã«ç€ºããã寞æ³ã¯ããã¹ã®èŒªéãã¹ãããŒã¯ããå€çžã®å€§ããã§ãããx-min ãš y-min ã¯åç¹ãããŒãžïŒãã¥ãŒããŒãïŒã®å·Šäžã«ããŠæž¬ã£ããã®ã§ããïŒå éšçã«ã¯ãã¥ãŒããŒãã®å·Šäžãåç¹ïŒã
ãŸããInkscape 0.44 ã§ãDocument Properties ãã€ã¢ãã°ãéããšãDefault Units ãšããèšå®é ç®ããããmm ãšã inch ãšãããŸããŸãªéžæè¢ããããããããããããã¯ãäžèšã®èšå®ã¡ãã¥ãŒãšåæ§ã«ããŠãŒã¶ã«èŠããåäœã ãã奜ã¿ã®åäœã«æç®ïŒ1 ãã¯ã»ã«ïŒ1/90ã€ã³ãã§ïŒããŠãããã ãã®è©±ã ã
次ã®ãããªã±ãŒã¹ãèããŠã¿ãããããšãã°ãInkscape ã® Dafault Units ã mm ã«èšå®ãã10 mm ã®ç·ãäœæãããšãããããã SVG ãã¡ã€ã«ã«ä¿åãããã®ãã¡ã€ã«ã 1 ãã¯ã»ã«ã 2/90 ã€ã³ãã«æç®ããå¥ã®ãŠãŒã¶ãšãŒãžã§ã³ãã§èªã¿èŸŒããšããã®ç·ã®é·ã㯠20 mm ã§åºåãããã¯ãã§ããã
ããã¥ãŒããŒãã®ãµã€ãºãããªã¡ãŒãã«ã«ããšãã°ãã¥ãŒããã¯ã¹ã¯ãããããããªãã
ãã¥ãŒããŒãã®ãµã€ãºãããªã¡ãŒãã«ã§æå®ããã ãã§ããã¥ãŒããã¯ã¹ãäœããªãã§ãããšããŠãŒã¶ç©ºéã«ããã 1 ãã¯ã»ã«ãäœããªã¡ãŒãã«ã«åœããããšããããšã«ã€ããŠã¯ããŠãŒã¶ãšãŒãžã§ã³ãä»»ãã«ãªã£ãŠããŸããInkscape 以å€ã®ãŠãŒã¶ãšãŒãžã§ã³ãã§ã®èªã¿èŸŒã¿ãèæ ®ãããšäžå®ã
ããã«ããŠãŒã¶ãšãŒãžã§ã³ãã SVG ã«æºæ ããŠãããšããŠããCSS2 ã§ã¯ 1 ãã¯ã»ã«ã®çµ¶å¯Ÿçãªå€§ããã¯åºåããã€ã¹ã®ç©ççãªæ¡ä»¶ã«ãã£ãŠãããã䌞瞮ããŠãããããšã«ãªã£ãŠããã®ã§ããã¯ãäžå®ãæ®ãã
ãã¥ãŒããã¯ã¹ã®ãããã«ãtransform å±æ§ã䜿ããšããã®ã¯ã©ããã
ãã®ãã¡æžããã
SVG ããèŠã Inkscape ã®æ©èœ
ã¯ããŒã³ãšã³ããŒ
ã¯ããŒã³ãšã³ããŒã¯ç°ãªãããããã¹ãã³ããŒãããšããªãªãžãã«ãšãã£ããïŒãã°ãã°äœçœ®ã ãç°ãªãïŒã® path ãšã¬ã¡ã³ããããäžã€äœæãããã®ã«å¯ŸããŠãã¯ããŒã³ã®å Žå㯠use ãšã¬ã¡ã³ããšäœ¿ã£ãŠããªãªãžãã«ã®ãªããžã§ã¯ããåŒçšãããã«éããªãã
ãªãªãžãã«ã®ãã¹ããã®ãŸãŸç§»åããããæ¡å€§ããŠãã¯ããŒã³ã®å€§ããã«ã¯å€åããªããããªãªãžãã«ã®ãã¹ãæ§æããããŒãã®ãã¡ã®äžã€ãåãããããããŒããã»ã°ã¡ã³ãã®åé€ã»è¿œå ãè¡ããšãããã¯ããããŸã¯ããŒã³ã«ãåæ ãããã
ããã¯ãuse ãšã¬ã¡ã³ãã¯ããªãªãžãã«ã®ãªããžã§ã¯ããšã¯ã¹ã€ã«ãç¬èªã« transform å±æ§ãæã£ãŠããããã§ããã
ã¬ã€ã€ãŒ
ã¬ã€ã€ãŒã¯ãSVG ã«èŠå®ããªããInkscape ã®ã¬ã€ã€ãŒã¯ãSVG çã«ã¯ãã ã®ã°ã«ãŒãã«éããªããInkscape ã§ã¯ãã°ã«ãŒããªããžã§ã¯ãã«ç¬èªã®åå空éã§å®çŸ©ããããããã£ãè¿œå ããŠãŠãŒã¶ã€ã³ã¿ãŒãã§ãŒã¹äžã§ç¹å¥ãªæ±ãããªãããããã«ããŠããããã¬ã€ã€ãŒãšåŒãã§ããã®ã§ããã
Inkscape ã§äœæããã¬ã€ã€ãŒã€ãã®ææžã Plain SVG ã§ä¿åãããããå床 Inkscape ã§éããšãç¬èªå®çŸ©ã®ããããã£ã倱ãããçµæãäžè¬çãªã°ã«ãŒãã (root) äžã«èŒã£ãŠããç¶æ ãšããŠèªã¿èŸŒãŸããã
äžè¬çãªã°ã«ãŒããã¬ã€ã€ã«ããããã«ã¯ãXML ãšãã£ã¿ã䜿ããã°ã«ãŒããªããžã§ã¯ãã« inkscape:groupmode ããããã£ãäœæãå€ã layer ã«ã»ããããŠãããã« inkscape:label ããããã£ãäœæãå€ã«ä»»æã®ã¬ã€ã€ãŒåãäžããŠããã°ãããïŒGUIãã¡ã³ã¯ãã°ã«ãŒãã®ååããæ°ã¬ã€ã€äœæãåãå Žæã«ããŒã¹ããã°ã«ãŒã解é€ãã¬ã€ã€ã®éå±€ã移åãïŒ
ã¬ã€ã€ãŒãã°ã«ãŒããªããžã§ã¯ãã§ãã以äžãå ¥ãåã«ããããšãã§ãããããããªããšæããInkscape 0.44 ã§è©Šã¿ãŠã¿ããã§ããããŠã£ã³ããŠã®ã¬ã€ã€ãŒè¡šç€ºéšã«ã¯èŠªã¬ã€ã€ãŒãåã¬ã€ã€ãŒãåçã«è¡šç€ºããããã芪ã¬ã€ã€ãŒãäžå¯èŠã«ãããšãããã¯åã¬ã€ã€ãŒã«ãåã³ã芪ã¬ã€ã€ãŒãåé€ãããšåã¬ã€ã€ãŒãåé€ãããã
å€åœ¢
ãªããžã§ã¯ãã®å€åœ¢ã»ç§»åæ¹æ³ã¯å€§å¥ãããšäºçš®é¡ãããäžã€ã¯ããªããžã§ã¯ããæ§æããã³ã³ãããŒã«ã»ãã€ã³ãèªäœã®äœçœ®æ å ±ãå€ããããšãããäžã€ã¯ããªããžã§ã¯ãã«ãtransform å±æ§ãå ããŠç§»åã»å€åœ¢ãããããšã§ããã
SVG ã«å®ãã®ãã transform å±æ§ã¯ãmatrix, translate, scale, rotate, skewX, skewY ãšãã 6 çš®é¡ã® "transform difinitions" ïŒããèš³æãã€ãã¬ãå€ææå®ãšãã£ããšããïŒã«ãã£ãŠã©ããå€åœ¢ãããããæå®ããããšãã§ãããããã¯ãåé·ãªæå®ã§ translate, scale, rotate, skewX, skewY ã¯ãã¿ãªçµå± matrix ã²ãšã€ã§æå®ã§ããå€æã§ããïŒãã ããèšç®ãèŠããïŒãInkscape ã«ã¯ãã® matrix ãç·šéããããã® GUI ã¡ãã¥ãŒãçšæãããŠããã
ããŠã¹ãçšãããªããžã§ã¯ãã®ç§»åãå転ã¯ãããäºéãã®ããæ¹ã®ãã¡ã®ããããã䜿ãããã©ã¡ãã䜿ãã㯠Inkscape ã®èšå®ã«ãã£ãŠæ±ºãŸãã
ãªããtransform å±æ§ãçšããå Žåããªããžã§ã¯ããæ¡å€§ãããšã茪éç·ã倪ããªãã®ã SVG éãã§ããããInkscape ã§ã¯ã茪éã倪ããªã£ãã现ããªã£ããããªããã茪éç·ã®å€ªãã調ç¯ããããèšå®ããããšãã§ããã
æåã³ãŒã
SVG1.1 ã§ã¯ãXML1.0 ã®æåã䜿ããšããããšã«ãªã£ãŠãããïŒhttp://www.w3.org/TR/SVG11/text.htmlïŒãXML ã®èŠå®ïŒhttp://www.w3.org/TR/REC-xml/ïŒãèŠããšããã¹ãŠã® XML ããã»ããµã¯ãUTF-8 ãš UTF-16 ãç解ã§ããªããŠã¯ãªãã¬ããšããããããŠãInkscape ã®ããã©ã«ãã UTF-8 ã§ãããäœãèããã« Inkscape ã§æ°èŠæžé¡ãã€ãããæ¥æ¬èªãå ¥åãããš UTF-8 ãçšããŠä¿åãããã
ãããã SVG ãã¡ã€ã«ããUNICODE ããµããŒãããŠããªãããã¹ãã»ãšãã£ã¿ã§éããŠãå€æŽãå ããŠä¿åããããããšãæ²æšãªããšã«ãªããããããªããïŒäºå®ããããªã£ãããšããïŒã
ãšã¯ãã£ãŠããSVG ã¯å¿ ããã UTF-8 ã䜿ããªããã°ãªãã¬ãšããããã§ã¯ãªããXML ã®ã»ãã§ã¯ã"ISO-2022-JP", "Shift_JIS", and "EUC-JP" ã®ããšãæžããŠããããã〠SVG ãã¡ã€ã«ã®å é ã«
<?xml version="1.0" encoding="Shift_JIS"?>
ãªã©ãšæžããŠãããããããã¹ããšã¬ã¡ã³ãã®äžèº«ãã·ãã JIS ã§æžãããŠã Inkscape ïŒå°ãªããšãç§ã®äœ¿ã£ãŠãã Linux ç Inkscape 0.44ïŒã¯ã¡ãããšèªã¿èŸŒãã§ãããã
ãããŒãïŒããã®ãã¡ã€ã«ã Inkscape ã® GUI ã䜿ã£ãŠå€æŽåŸå床ä¿åããããããã£ãš UTF-8 ã«æ»ã£ãŠããŸããããã€ã¯ããã©ã«ãã«ããã³ãŒãã£ã³ã°ã·ã¹ãã ãã©ããã§èšå®ã§ããã®ãããããªãããã©ãç§ã«ã¯ãããã¬ããã£ã±ã Inkscape ã§ã¯ UTF-8 ãç¡é£ãã
ããã¹ãã®æµã蟌ã¿
Inkscape 㯠flowed text ã®æ©èœãæã£ãŠã¯ãããflowed text ãšããã®ã¯ããæµã蟌ãŸããããã¹ããã
SVG 1.1 ã«ã¯ flowed text ã«ã€ããŠå®ããŠããªããInkscape ã® flowed text 㯠SVG 1.2 ã®å€ãçã®èçš¿ãããšã«ããŠããã®ã§ãä»åŸ SVG 1.2 ã確å®ããŠããããã«æ²¿ã£ãŠããå¯èœæ§ã¯äœããïŒhttp://wiki.inkscape.org/wiki/index.php/FAQ#What_about_flowed_text.3F åç §ïŒ
ããã¹ãæµã蟌ã¿ã¯ãInkscape ã SVG ã«æºæ ããŠããªãéšåã§ããããã¡ãããä»ã®ãŠãŒã¶ã»ãšãŒãžã§ã³ãããã¡ããšããã解éããå¯èœæ§ã¯äœãã
ãã¡ããçŸæ®µéã® SVG 1.2 ã® draft ãããã¯èŠãŠã¿ãããhttp://www.w3.org/TR/2004/WD-SVG12-20041027/flow.html
http://wiki.inkscape.org/wiki/index.php/FAQ#What_about_flowed_text.3F ã§ã¯ãInkscape ã® flowing text ãçšãã SVG ãã¡ã€ã«ãä»ã®ãšãŒãžã§ã³ãã§èªã¿èŸŒãŸãããªãã°ãããããããããã¹ãã«å€æããçšã㊠flowing text ã䜿ããªãããã«å€æããŠããããå§ããŠãããïŒç§ã¯ãããè©ŠããŠã¿ãããããŸããããªãå Žåããã£ãããªãã ããŸã 調ã¹ãŠããªãïŒã
ãã¡ãã Inkscape ã§äœæãã SVG ã®ã³ãŒããèŠãŠã¿ããïŒããã¯å€ãæ å ±ãããããªãïŒ
flowRoot ãªããžã§ã¯ãã®äžã« flowRegion ãªããžã§ã¯ããš flowPara ãªããžã§ã¯ãããããflowRegion ãªããžã§ã¯ãã®äžã« rect ãªã©ã®æç»ããããªããžã§ã¯ããããã°ããããããå žåçãªéå±€é¢ä¿ã¯ãããšãã°
flowRoot flowRegion rect circle etc. ...... flowPara
ãŠãªå ·åã ãflowPara ãªããžã§ã¯ãã¯æµã蟌ãŸããæååãä¿æããflowRegion ã®åèŠçŽ ã® rect ã circle ... ã¯ãæååãæµã蟌ãŸãããªããžã§ã¯ãã§ããã
èæ¯è²
SVG ã«ã¯èæ¯è²ãšããæŠå¿µããªããèæ¯è²ã¯ãŠãŒã¶ãšãŒãžã§ã³ãã«ä»»ãããŠããã
äžæ¹ãInkscape ã® Document Properties ãã€ã¢ãã°ã»ããã¯ã¹ã«ã¯ãGeneral ã®ã»ã¯ã·ã§ã³ã« Background ãšããé ç®ããããèæ¯è²ãšãã®äžéæ床ãèšå®ã§ããããã«ãªã£ãŠããã
ãã®ãèæ¯è²ãã¯ãSVG ã®èŠæ Œã«ã¯ãªãæ å ±ã Inkscape ãæžãå ããŠããã®ã§ãããããã Inkscape SVG ã§ä¿åãããã®ãèŠããšãããšãã°æ¬¡ã®ããã«ä¿åãããŠããããšããããã
<sodipodi:namedview ïŒäžç¥ïŒ inkscape:pageopacity="0.7254902" ïŒäžç¥ïŒ bordercolor="#666666" ïŒäžç¥ïŒ />
ãã®ãšã¬ã¡ã³ã㯠SVG å€ã§ãããããä»ã®ãŠãŒã¶ãšãŒãžã§ã³ãã§èªã¿èŸŒãã å Žåã«ã¯ãã»ãšãã©ã®å Žåç¡èŠãããããŸããInkscape ã§ã Plain SVG ã§ä¿åãããšããã®èæ¯è²æ å ±ã¯ãã¡ã€ã«ã«æžã蟌ãŸãªãã
ããŒã«
SVG ã§ã¯ãã·ã³ãã«ãšãããšã¬ã¡ã³ãã§ã²ãªãããšãªãå³åœ¢ãªããžã§ã¯ããå®çŸ©ããŠãuse ãšã¬ã¡ã³ãã«ãã£ãŠãããåŒçšïŒæ£ç¢ºã«ã¯ instantiateïŒããããšãã§ãããåãå³åœ¢ãè€æ°å䜿ããããªå Žåããã® symbol ãš use ã䜿ã£ãŠå®çŸãããšæ¥œãã§ããã
ããã«ãSVG ã¯ç¢å°ã®é ïŒéïŒãããïŒãå®çŸããããã«ãã·ã³ãã«æ©èœãç¹æ®åãããæ段ãçšæããŠããããããªå ·åã ã
ãŸããmarker ãšãããšã¬ã¡ã³ãã§ã被åŒçšåŽã®å³åœ¢ãå®çŸ©ãããã€ãã«ãpath, line, polyline, polygon ãšãã£ãéãã€ããããªããžã§ã¯ãïŒãè¡šçŸããŠãããšã¬ã¡ã³ãïŒã«ãmarker-start, marker-end, marker-mid ãšãã£ãããããã£ãäžãããã®å€ãšããŠå ã«å®çŸ©ããããŒã«ã® id ãæå®ãããããã§ãmarker-start, marker-end, marker-mid ã®éãã¯ãéãä»å ããå Žæã®éãã§ããããããã¹å§ç¹ãçµç¹ããã以å€ã®ãã€ã³ãïŒããŒãïŒã«å¯Ÿå¿ãããããã§ãéãå®çŸããããïŒéã¯ãã¹ã«å¯ŸããŠã€ãããããã®ã§ããããµããã¹ââéšåãã¹ââã«å¯ŸããŠã€ããããšã¯ã§ããªãïŒ
ãããªããã§ãç¢å°ã®æ£ã®éšåïŒãã¹ïŒã«ã¹ãããŒã¯ãã€ã³ããæœããŠããéïŒãããïŒã®éšåã®è²ãå€ãããªããããšãã°ãèµ€ãç®ïŒã®ïŒã«é»ãéïŒãããïŒã®ç¢ãã§ããŠããŸãã
XML ãšãã£ã¿ã§ãpath ãšã¬ã¡ã³ãã® marker-end ããããã£ã®å€ãèªã¿ããããæã marker ãšã¬ã¡ã³ããæ¢ãïŒmarker ãšã¬ã¡ã³ãã¯ãdefs ãšã¬ã¡ã³ãã®äžäœã«èŠã€ããã ãããïŒåœè©² marker ãšã¬ã¡ã³ãã® fill ããããã£ã®å€ã¯è²ã瀺ããŠããã®ã§ãããããããããã ããInkscape 0.44 Linux çã§è©Šãããšããããã®å€æŽã¯å³åº§ã«ã¯ç»é¢ã«åæ ãããªããäžåºŠä¿åããŠãåã³èªã¿èŸŒãã§ã¿ããšïŒããã¡ã€ã«ã«åŸ©åž°ãïŒã¯ãããŠåæ ãããããã£ãšããããã§ã¯ã以åŸåãéïŒããŒã«ïŒã䜿ããšãã¿ãªãã®è²ãå€ãã£ããã®ã«ãªã£ãŠããŸãããããå«ãªãã°ã該åœãã marker ãšã¬ã¡ã³ããã³ããŒããŠããå€æŽãããã® marker ã® id ãéãã€ãã path ã® marker-end ããããã£ã«èšããŠããã°ããã
ãæ¥ãã®åãã¯ãã¹ãããŒã¯ããã¹ã«å€æããŠéããã£ã«ããã®ããããããããªãã
ç§ã®ç°å¢ã§ã¯ã/usr/share/inkscape/tutorials/making_markers.svg ãšãããã¥ãŒããªã¢ã«ãã€ã³ã¹ããŒã«ãããŠãããããã«ãããšãmarker ãšã¬ã¡ã³ããæžããŠãmarker.svg ãšãããã¡ã€ã«ïŒç§ã®ãšãã§ã¯ /usr/share/inkscape/markers/markers.svg ã«ãã£ãïŒã«è¿œå ããŠãããšãã®ã¡ã®ã¡äœ¿ããŸãããã§ãããšã®ããšãæããªãã®ã§è©ŠããŠãªããã©ããšããã§ããã®ãã¡ã€ã«ãããŒã ãã£ã¬ã¯ããªä»¥äžã«çœ®ãããšã¯ã§ããã®ããªãïŒ
ãã¹ãå¡ãã€ã¶ã
Inkscape ã§è€éãªåœ¢ã®ãã¹ãæãéãã«å¡ãã€ã¶ãããã«ã¯ãSVG ããã¹ã®ãå åŽããšãå€åŽããã©ãå®çŸ©ããŠããã®ããèŠãŠããå¿ èŠãããïŒããïŒïŒã
SVG ã§ã¯ããã€ã³ããã€ãã€ãã«ã»ã°ã¡ã³ãã§ã€ãªãã§äœã£ãã²ãšç¶ãã®ç·ããµããã¹ãšããããã¹ã¯äžã€ä»¥äžã®ãµããã¹ã®éåã§ãããšããŠãããGimp ãªãããšããã¥ã¢ã«ã§ã®çšèªãéãã®ã§æ³šæã ã
SVG ã§ã¯ç«¯ç¹ãéããŠããªããµããã¹ã¯ããã£ã«ãè¡ãïŒå¡ãïŒãšãã«ã¯ã端ç¹ãéããŠãããšä»®å®ããããInkscape 㧠V ååã®ãµããã¹ãå¡ãã€ã¶ããšãéäžè§ã«ãªãã®ã¯ãããã«ãããã®ã
SVG ã«ãããŠããã¹ã¯ãã®å åŽãå¡ãã€ã¶ãããšãã§ãããå€åŽãå¡ãã€ã¶ããšããããšã¯ã§ããªããããã¯ããçµµæããããé¢ã¯ç¡éã®åºãããæã£ãŠããŠãããªã³ãã¢ãŠããããã®ã¯ããŸããŸãã®äžéšã§ãããšãã SVG ã®èãæ¹ã«å¯Ÿå¿ããŠããã®ã ããã
ãã¹ã®å åŽãå¡ãã€ã¶ããšãã®ãã£ãããªåé¡ã¯ããã¹ãèªåèªèº«ã暪åã£ãŠãããïŒïŒ®ïŒŽïŒŽã®ããŒã¯ïŒãå éšã«ãµããã¹ãå«ãã§ãããïŒããŒããåïŒããå Žåã«èµ·ããããå åŽãå¡ããã®ã§ãããããããã¯ãã£ã³ãã¹äžã®ä»»æã®ç¹ãåœè©²ãã¹ã®ãå åŽããšèããããå€åŽããšèããããšããåé¡ã ãšèšãæããããšãã§ããã
å åŽã»å€åŽã決ããã®ã¯ããã¹ãæ§æããã»ã°ã¡ã³ãã®æ¹åïŒèªèº«ãšäº€ããããªãéãããµããã¹ã®å Žåãããã¯æèšãŸãããšãåæèšãŸãããšãããåé¡ã§ããïŒãšãfill-rule ãšããããããã£ãèæ ®ãããã
SVG ã¯ãpath ãšã¬ã¡ã³ããš polyline ãšã¬ã¡ã³ã㯠fill-rule ããããã£ãæã€ããšãã§ãããšå®ããŠãããfill-rule ããããã£ã¯ nonzero ããã㯠evenodd ãšããå€ããšãããããã®å€ã®ç€ºãæå³ã¯ä»¥äžã®åŠãã
ãã£ã³ãã¹ïŒç¡éã®åºãããæã€ã®ã ïŒäžã®ä»»æã®ç¹ãããç¡éã®åœŒæ¹ã«åããŠåçŽç·ãåŒãããšãæ³åãããSVG ã¯ããã ray ãšè¡šçŸããŠããïŒããã«æ°åŠçšèªã§åçŽç·ã®ããšã ray ãšãããããªã®ã ããå ç·ã ããæ¹åããããšèãããšè¶£ãæ·±ããïŒã
ray ã¯ãã¯ãã 0 ãšããã«ãŠã³ããæã£ãŠããã
ray ã®é²è¡æ¹åã«åãã£ãŠå³æãå³åŽãå·Šæãå·ŠåŽãšåŒã¶ããšã«ããã
åé¡ãšãªããã¹ãæ§æããã»ã°ã¡ã³ããïŒããã¯æ¹åãæã£ãŠããã®ã§ïŒ ray ã®å·ŠåŽããå³åŽã«æšªåãå Žåãã«ãŠã³ãã« 1 ãå ç®ãããå³åŽããå·ŠåŽã«æšªåãå Žåã«ãŠã³ããã 1 ãåŒãããã
ããã㊠ray ãç¡éã®åœŒæ¹ã«å°éãããšãã®ã«ãŠã³ãã«ãã£ãŠãray ã®åºçºç¹ãåœè©²ãã¹ã®å åŽã§ãããå€åŽã§ããããå®ãŸãã
fill-rule ããããã£ã nonzero ã®å Žåãã«ãŠã³ãã 0 ãªãå€åŽãããã§ãªããã°å åŽãšå®çŸ©ãããã
fill-rule ããããã£ã evenodd ã®å Žåãã«ãŠã³ããå¥æ°ãªãå åŽãå¶æ°ãªãå€åŽãšå®çŸ©ãããã
SVG ã§ã¯ãfill-rule ã®åæå€ã¯ nonzero ã§ããã
ãããã®æ¹åã«åã㊠RAY ãç §å°ãããã«ãã£ãŠããã®ç¹ãåœè©²ãã¹ã®ãå åŽãã§ããããå€åŽãã§ãããã®æ±ºå®ã«éãã¯èµ·ãããªããåè¿°ã®ããšãããµããã¹ã¯å¿ ãéããŠãããšä»®å®ãããŠããããã§ããã
次ã®äŸã¯ããã¡ã°ãå°ããåã®å éšããå åŽãããå€åŽããã調ã¹ãããã«ãåå¿åã®äžå¿ãã RAY ãç §å°ããŠã«ãŠã³ãã調ã¹ãŠããæ§åã®å³ããã¡ã°ã倧ããåã®ååšãŸã§ RAY ãéããŠã¯ãããŠããã¡ã°ãå°ããåã®å éšããå åŽãããå€åŽãããå®ãŸãã
ãªãã1 ã足ããŠãåŒããŠããããå¶å¥ã«äžãã圱é¿ã¯åããªã®ã§ãfill-rule ã evenodd ã§ããã°ã¯ãã¹ã®æ¹åã¯ãŸã£ããåé¡ã«ãªãã¬ãšããããšã«ãªãã
è足ãªãããSVG ã§å¡ãã€ã¶ããå®çŸ©ãããŠããã®ã¯ããããŸã§ãäžã€ã®ãã¹ã«å¯ŸããŠã§ãããè€æ°ã®ãã¹ã«å¯ŸããŠã§ã¯ãªããäžã«æ²ããåå¿åã®äŸã§ã¯ãåã²ãšã€ã²ãšã€ããµããã¹ãšããŠãããããäžã€ã®ãã¹ã«çµåãããã
Inkscape ã§ã®å®è£ ãã¹ã®æ¹åã¯ããã£ãšãåçŽãªäŸã§ã¯ããããžãšæ²ç·ïŒçŽç·ããŒã«ãã§ãã€ã³ããæã€é çªã«ãã£ãŠæ±ºãŸããæåŸã«æã£ããã€ã³ããçµç«¯ãšããããã«ãã®ãµããã¹ã®æ¹åã決ãŸãããã¹ã®æ¹åãèŠèŠçã«ç¢ºèªããããšæããªãã°ãã¹ãããŒã¯ã¹ã¿ã€ã«ã§ç¢å°ãéžæããŠããã°ããã
Inkscape 0.44 ããã¯ãã«ã¹ã±ãŒãã¡ãã¥ãŒã®ãã¹ãåŒã£åŒµããšãé転ããšããã®ããããããã䜿ããšæ¹åãå転ãããããšãã§ããã
ãåïŒåŒ§ãããŒã«ã§åãæ¥åãªã©ãäœæãããšããã¹ã®æ¹åã¯æèšãŸããã«ãªãã
evenodd ã nonzero ããéžæããããã«ã¯ãããã£ã«ïŒã¹ãããŒã¯ãããŒã«ã®ããã£ã«ãã¿ããéžæãããšãã«å³äžã«åºãŠããããŒããããã®ãããªãã®äºçš®ã®ãããããéžã¶ãå·ŠåŽã®ã evenodd ã§ãå³åŽã®ã nonzeroããããã¯ãXML ãšãã£ã¿ãèµ·åããŠæå㧠fill-rule ããããã£ãä¿®æ£ããããšãã§ããã
Inkscape ã§ã¯ãfill-rule ããããã£ããªããã¹ãšã¬ã¡ã³ããèªã¿èŸŒããš nonzero ãšè§£éããããããã㯠SVG éãã