gpn20: improve intros

This commit is contained in:
Sophie Schiller 2022-05-17 21:46:53 +02:00
parent 5063f71f72
commit 454197fc18
4 changed files with 42 additions and 49 deletions

View file

@ -132,15 +132,15 @@ def debug():
'../intro.ts', '../intro.ts',
introFrames, introFrames,
{ {
'$title': "Long Long Long title is LONG", '$title': "Long Long Long title is LONG ",
'$speaker': 'Long Name of Dr. Dr. Prof. Dr. Long Long' '$speaker': 'Long Name of Dr. Dr. Prof. Dr. Long Long'
} }
) )
render('outro.svg', #render('outro.svg',
'../outro.ts', # '../outro.ts',
outroFrames # outroFrames
) #)
def tasks(queue, args, idlist, skiplist): def tasks(queue, args, idlist, skiplist):

View file

@ -16,7 +16,8 @@
version="1.1" version="1.1"
id="SVGRoot" id="SVGRoot"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)" inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="intro-2.svg"> sodipodi:docname="intro.svg"
enable-background="new">
<defs <defs
id="defs815"> id="defs815">
<linearGradient <linearGradient
@ -86,8 +87,8 @@
inkscape:pageopacity="0.0" inkscape:pageopacity="0.0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:zoom="0.7" inkscape:zoom="0.7"
inkscape:cx="1676.0588" inkscape:cx="810.40454"
inkscape:cy="531.20051" inkscape:cy="499.40849"
inkscape:document-units="px" inkscape:document-units="px"
inkscape:current-layer="layer3" inkscape:current-layer="layer3"
showgrid="false" showgrid="false"
@ -3085,7 +3086,7 @@
inkscape:groupmode="layer" inkscape:groupmode="layer"
id="layer3" id="layer3"
inkscape:label="texte" inkscape:label="texte"
style="opacity:1"> style="opacity:1;">
<rect <rect
style="opacity:0;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.54968041;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" style="opacity:0;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.54968041;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect16064-4" id="rect16064-4"
@ -3104,49 +3105,29 @@
ry="0" /> ry="0" />
<flowRoot <flowRoot
xml:space="preserve" xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:80px;line-height:125%;font-family:Roboto;-inkscape-font-specification:'Roboto, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr;text-anchor:start;fill:#f0f0f0;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333206px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
id="title"><flowRegion
id="flowRegion16068"
style="fill:#f0f0f0;fill-opacity:1;-inkscape-font-specification:'Roboto, Normal';font-family:Roboto;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:80px;text-anchor:start;text-align:start;writing-mode:lr;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;"><use
x="0"
y="0"
xlink:href="#rect16064"
id="use16070"
width="100%"
height="100%" /></flowRegion><flowPara
id="flowPara16072"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:80px;font-family:Roboto;-inkscape-font-specification:'Roboto, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr;text-anchor:start;fill:#f0f0f0;fill-opacity:1;">$title</flowPara></flowRoot> <rect
style="opacity:0;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:#0000ff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect16050"
width="937.14288"
height="511.42859"
x="912.85712"
y="57.142857" />
<rect
style="opacity:0;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:#0000ff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect16052"
width="181.42857"
height="17.142857"
x="937.14288"
y="158.57143" />
<rect
style="opacity:0;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:#0000ff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect16054"
width="135.71431"
height="165.71428"
x="912.85712"
y="57.142857" />
<flowRoot
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333333px;line-height:125%;font-family:Roboto;-inkscape-font-specification:'Roboto, Normal';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr;text-anchor:start;fill:#f0f0f0;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;"
id="persons"><flowRegion id="persons"><flowRegion
id="flowRegion16091" id="flowRegion3669"
style="-inkscape-font-specification:'Roboto, Normal';font-family:Roboto;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;font-size:53.33333333px;text-anchor:start;text-align:start;writing-mode:lr;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;"><use style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333206px;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;"><use
x="0" x="0"
y="0" y="0"
xlink:href="#rect16064-4" xlink:href="#rect16064-4"
id="use16093" id="use3671"
width="100%" width="100%"
height="100%" /></flowRegion><flowPara height="100%" /></flowRegion><flowPara
id="flowPara18101">$persons</flowPara></flowRoot> </g> id="flowPara3673"
style="-inkscape-font-specification:Roboto;font-family:Roboto;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal">$persons</flowPara></flowRoot> <flowRoot
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:80px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
id="title"><flowRegion
id="flowRegion4931"
style="fill:#ffffff;fill-opacity:1;"><use
x="0"
y="0"
xlink:href="#rect16064"
id="use4933"
width="100%"
height="100%" /></flowRegion><flowPara
id="flowPara4935"
style="-inkscape-font-specification:Roboto;font-family:Roboto;font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal">$title</flowPara></flowRoot> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 136 KiB

View file

@ -52,6 +52,10 @@ parser.add_argument('--imagemagick', action="store_true", default=False, help=''
Render frames using ImageMagick instead of Inkscape. Render frames using ImageMagick instead of Inkscape.
Usage: ./make.py yourproject/ --imagemagick Usage: ./make.py yourproject/ --imagemagick
''') ''')
parser.add_argument('--resvg', action="store_true", default=False, help='''
Render frames using resvg instead of Inkscape.
Usage: ./make.py yourproject/ --resvg
''')
if len(sys.argv) < 2: if len(sys.argv) < 2:
parser.print_help() parser.print_help()

View file

@ -91,12 +91,20 @@ def renderFrame(infile, task, outfile):
with Image(filename=infile) as img: with Image(filename=infile) as img:
with img.convert('png') as converted: with img.convert('png') as converted:
converted.save(filename=outfile) converted.save(filename=outfile)
elif args.resvg:
# invoke inkscape to convert the generated svg-file into a png inside the .frames-directory
cmd = 'resvg --background white --width={1} --height={2} "{4}" "{3}" 2>&1 >/dev/null'.format(task.workdir, width, height, outfile, infile)
errorReturn = subprocess.check_output(cmd, shell=True, universal_newlines=True, stderr=subprocess.STDOUT, cwd=task.workdir)
if errorReturn != '':
print("resvg exited with error\n" + errorReturn)
# sys.exit(42)
else: else:
# invoke inkscape to convert the generated svg-file into a png inside the .frames-directory # invoke inkscape to convert the generated svg-file into a png inside the .frames-directory
cmd = 'inkscape --export-background=white --export-background-opacity=0 --export-width={1} --export-height={2} --export-png="{3}" "{4}" 2>&1 >/dev/null'.format(task.workdir, width, height, outfile, infile) cmd = 'inkscape --export-background=white --export-background-opacity=0 --export-width={1} --export-height={2} --export-png="{3}" "{4}" 2>&1 >/dev/null'.format(task.workdir, width, height, outfile, infile)
errorReturn = subprocess.check_output(cmd, shell=True, universal_newlines=True, stderr=subprocess.STDOUT, cwd=task.workdir) errorReturn = subprocess.check_output(cmd, shell=True, universal_newlines=True, stderr=subprocess.STDOUT, cwd=task.workdir)
if errorReturn != '': if errorReturn != '':
print("inkscape exitted with error\n" + errorReturn) print("inkscape exited with error\n" + errorReturn)
# sys.exit(42) # sys.exit(42)
def cachedRenderFrame(frame, frameNr, task, cache): def cachedRenderFrame(frame, frameNr, task, cache):