[SFD-discuss] Call for Help on SVG Counter

Frederic Muller - DFF fred at digitalfreedomfoundation.org
Tue Sep 24 15:50:48 UTC 2019


Hey!

I hope you had a great SFD. mine is still in the making here (public
holidays conflict).

So after playing with the extension I had issues, some which I fixed
(like finding the text size in pixel - which is not the value displayed
in Inkscape), some which I didn't unfortunately. Still trying to figure
out how to insert a comma in some of the text. Apparently the current
csv import doesn't support that. I emailed the extension creator but
didn't get any response yet. It seems I would need to replace the csv
interpreter code to allow comma to be accepted.

And since now you have time I am still a bit confused about the other
alternative which was having a script inside the SVG file and making it
run from SFD's servers. What am I missing?

Thank you.

Fred

On 9/24/19 8:23 PM, Maren Hachmann wrote:
> Hi Fred,
> 
> glad it works! That extension is really very useful.
> 
> The only thing it can't do is to adjust the width of the text
> automatically, not sure if that's a problem. Using centered text helps
> to alleviate the issue.
> 
> I didn't remember that the generator extension would also do the
> exporting to the format you'd need, that's why I added the export
> extension to the mix - good that it's not needed :)
> 
> Is there still anything left for me to do? (I could probably add
> functionality to query the text object's width and to scale it down to
> the desired max width. Always wanted to put that in anyway...)
> 
> Maren
> 
> Am 19.09.19 um 13:00 schrieb Frederic Muller - DFF:
>> Wow Excellent!
>>
>> So don't worry it's not going to be for this SFD! Now I've downloaded
>> and install ink-generator and played with the sample file: everything works.
>>
>> I'm currently using inkscape v. 0.92 (Fedora) so no issue with using
>> v1.0 yet.
>>
>> I am not sure why I would need the export object extension though. Is it
>> because we have move than 1 design in the same file?
>>
>> The way I look at it as we have a few languages we'll have all the
>> "numbered" countdown file in the same svg/csv for all languages
>> (actually they don't change anymore until we change the whole countdown
>> design).
>>
>> Then we have 3 files to edit and export per language each year. They are
>> actually 1 file with 3 different texts. Only Spanish has a text size
>> change in 1 image because the text is too long. Maybe I could add font
>> size as a parameter (though it switches from 1 line to 2 smaller lines -
>> maybe something we can improve). Again I'd have 1 svg/csv pair to
>> generate those 3 images x translations.
>>
>> So we'd end up 2 svg/csv, using on 1 pair in fact, except if we change
>> the countdown design.
>>
>> And then we (I ;-) ) manually upload the 3 images in the wiki.
>>
>> Please correct me if I missed anything!
>>
>> Thank you very much.
>>
>> Fred
>>
>> On 9/19/19 5:16 PM, Maren Hachmann wrote:
>>> Hi Fred,
>>>
>>> yes, this should be possible, using the inkscape-generator extension
>>> that is available in Ubuntu repositories (example files that can serve
>>> as instructions here:
>>> https://inkscape.org/~Moini/%E2%98%85example-files-for-generator-extension)
>>> and the export-objects extension (
>>> https://gitlab.com/su-v/inx-exportobjects).
>>>
>>> Both extensions may need to be adjusted (if you want to use Inkscape 1.0
>>> at some point, they have to be), and a script would need to be written
>>> to wrap them.
>>>
>>> I'm busy currently with our Kielux event, so cannot help you with it
>>> before this year's SFD. For the next one, I think I could.
>>>
>>> (or even an extension could be made from these two, as a combo)
>>>
>>> Maren
>>>
>>> Am 19.09.19 um 11:49 schrieb Frederic Muller - DFF:
>>>> Hi!
>>>>
>>>> Thank you for all your explanation. Reading again your email it is a lot
>>>> of choices to make ;-)
>>>>
>>>> I initially thought it was possible to include everything inside the SVG
>>>> image and that people could just reference it as they do with the png
>>>> file today. From my recent searches it seems not, and JS is always
>>>> needed and causes issues you're referring to.
>>>>
>>>> So with that in mind I'd rather go for a script that takes the initial
>>>> design, pick a language (from?) and generate 100 or 300 png files with
>>>> the right name for each language.
>>>>
>>>> Is this possible?
>>>>
>>>> Thank you.
>>>>
>>>> Fred
>>>>
>>>> On 8/28/16 11:24 PM, Maren Hachmann wrote:
>>>>> Hi Fred,
>>>>>
>>>>> Am 28.08.2016 um 06:48 schrieb Frederic Muller - DFF:
>>>>>> Thank you for the answer. We actually discuss with the topic at
>>>>>> length with Alexandro and maybe others 3 years ago. There was a
>>>>>> small bug in the display of the SVG between Inkscape and the
>>>>>> rendering engine making the text slightly off.
>>>>>
>>>>> - Rendering engine? You mean the browser?
>>>>>
>>>>>> That's about as much as I remember. I can't even remember how to
>>>>>> edit the file now if it's not using a text editor.
>>>>>
>>>>> - That I can do ;-)
>>>>>
>>>>>> So back to what we want is actually replacing the current PNG files
>>>>>> for our countdown with SVG file(s). We believe this would help us
>>>>>> better manage translations and re-editing the file year after year.
>>>>>> So it should be able to display the SFD countdown image (we have
>>>>>> the SVG source so that should be ok) and deduct 1 day everyday as
>>>>>> we get closer to SFD. Also the current availability of the files
>>>>>> make it possible for people to  chose the SFD date based on their
>>>>>> timezone. So it is pretty simple to just copy & paste the code and
>>>>>> insert it in a blog or website.
>>>>>
>>>>> - You want the thing to work client-side, right? Not via a script that
>>>>> serves the image-of-the-day from the sfd website? That's what I gather
>>>>> from the unfinished SVG file in the Wiki.
>>>>>
>>>>> That's actually the hard part for including in a blog. You need to use
>>>>> iframe, embed or object tags, or paste the source of the image
>>>>> directly into the html to get the counter js to work, if it's included
>>>>> in the SVG image, as far as I know.
>>>>>
>>>>> img tags will *not* work.
>>>>>
>>>>> So would the iframe thing be desirable? I'm not sure if everyone can
>>>>> include one on their blog, that's why I'm asking.
>>>>>
>>>>> Or would it be more practical to create those 60 svg (or even better,
>>>>> png) files automatically and have them work like the pngs currently?
>>>>> That's easy to do with Inkscape and either some own scripting or a
>>>>> preexisting Inkscape extension.
>>>>>
>>>>> That's a solution which would work for everyone, but would still
>>>>> require that a script be run on your server (which requires a gui if
>>>>> one uses Inkscape for it... :/) or on the translators' local machines
>>>>> to create the single svg/png files.
>>>>>
>>>>> We should also make sure to either use a font that is readily
>>>>> available for everyone, to convert the text to paths in the process
>>>>> (using Inkscape), or to include/link to the font file when using an
>>>>> SVG, or just to use a png.
>>>>>
>>>>> Do you have any preferences? Or would you just like to have it work
>>>>> easily?
>>>>>
>>>>> What I would do is:
>>>>> - modify the SVG image
>>>>> - add instructions for translators into the svg file, ask them to
>>>>> install the necessary fonts, so they can adapt the size of their texts
>>>>> correctly
>>>>> - only have them translate those few strings, then ask them to upload
>>>>> the changed SVG file
>>>>> - provide instructions how to generate the pngs automatically, using
>>>>> Inkscape (with gui) and a csv file for the dates on a computer where
>>>>> the required fonts are installed
>>>>> - have you continue serving the png images using the working script
>>>>> you have
>>>>>
>>>>> It's less sophisticated, and less automatical, than the js version,
>>>>> but makes work easy for translators and works for all kinds of blogs.
>>>>> Even when you visit them using IE ;-)
>>>>>
>>>>> What do you think?
>>>>>
>>>>> (If you prefer the other option, I would also prepare the file for the
>>>>> iframe/embed/object option, only my javascript foo is weak - I can
>>>>> tell you the steps that need to be performed / the ids that would need
>>>>> to be adapted, but can't write it myself).
>>>>>
>>>>> Regards,
>>>>>  Maren
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> SFD-discuss mailing list
>>>>> SFD-discuss at sf-day.org
>>>>> http://mail.sf-day.org/lists/listinfo/sfd-discuss
>>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> SFD-discuss mailing list
>>>> SFD-discuss at sf-day.org
>>>> http://mail.sf-day.org/lists/listinfo/sfd-discuss
>>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> SFD-discuss mailing list
>>> SFD-discuss at sf-day.org
>>> http://mail.sf-day.org/lists/listinfo/sfd-discuss
>>>
>>
>>
>>
>> _______________________________________________
>> SFD-discuss mailing list
>> SFD-discuss at sf-day.org
>> http://mail.sf-day.org/lists/listinfo/sfd-discuss
>>
> 
> 
> 
> 
> _______________________________________________
> SFD-discuss mailing list
> SFD-discuss at sf-day.org
> http://mail.sf-day.org/lists/listinfo/sfd-discuss
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mail.sf-day.org/pipermail/sfd-discuss/attachments/20190924/c62717ef/attachment-0001.pgp>


More information about the SFD-discuss mailing list