{"id":511,"date":"2015-05-18T08:39:34","date_gmt":"2015-05-18T06:39:34","guid":{"rendered":"http:\/\/heppg.de\/ikg\/wordpress\/?p=511"},"modified":"2015-10-05T06:48:02","modified_gmt":"2015-10-05T04:48:02","slug":"ascratchpangofont-problem-in-new-scratch","status":"publish","type":"post","link":"https:\/\/heppg.de\/ikg\/wordpress\/?p=511","title":{"rendered":"aScratchPangoFont-Problem in &#8217;14-Jan-15&#8242; scratch"},"content":{"rendered":"<p>Remark: For raspbian &#8216;jessie&#8217; and scratch &#8220;Scratch 1.4 (linux) of 2015-09-15&#8221;, this problem is solved.<\/p>\n<p>In scratch &#8220;Scratch 1.4 of 14-Jan-15&#8221;, as provided in raspbian for Raspberry Pi, there is a serious bug which prevents projects from loading. This affects scratch projects which are stored\/reloaded multiple times, and only scratch projects which use texts in new created sprite costumes. The error popup is &#8220;primSetFont:size:bold:italic:antialias: failed&#8221;<\/p>\n<h3><a href=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/error.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-518\" src=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/error.png\" alt=\"error\" width=\"454\" height=\"160\" \/><\/a><\/h3>\n<h3>Problem description<\/h3>\n<p>When loading a project, occasionally the following problem occurs<\/p>\n<p><a href=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/pango_001.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-512\" src=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/pango_001.png\" alt=\"pango_001\" width=\"1034\" height=\"817\" \/><\/a><\/p>\n<p>The error message is &#8220;primSetFont&#8221;.<\/p>\n<h3>Reproduce the problem<\/h3>\n<p>In a new project, create a new sprite with the edit-button. Add a text to this sprite. Close the editor and save the project &#8211;&gt; &#8220;x00&#8221;. Close scratch.<\/p>\n<p>Start scratch, open project &#8220;x00&#8221;.<br \/>\nOpen the costume with the font,, click to the &#8216;T&#8217;ext button. There is &#8220;a ScratchPan&#8230;&#8221; displayed. Close editor with &#8216;cancel&#8217;. Save project as &#8220;x01&#8221;. Close scratch.<\/p>\n<p>Start scratch, open project &#8220;x01&#8221;, save as &#8220;x02&#8221;. Close scratch.<br \/>\nRepeat this till you reach &#8220;x05&#8221;. When loading &#8220;x05&#8221;, you should get this problem.<\/p>\n<h3>Technical Details<\/h3>\n<p>When looking to the project.sb-file of an affected project, there is a sequence shown where the original &#8216;DejaVu&#8217;-Font is wrapped into a &#8216;s ScratchPangoFont&#8217; multiple times.<br \/>\nThis wrapping seems to occur each time on save, and after a few times the length exceeds some limit. This happens with all fonts, I found no exceptions.<\/p>\n<div id=\"attachment_520\" style=\"width: 801px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/sb.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-520\" class=\"wp-image-520 size-full\" src=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/sb.png\" alt=\"sb\" width=\"791\" height=\"161\" \/><\/a><p id=\"caption-attachment-520\" class=\"wp-caption-text\">project.sb file in a plain text editor.<\/p><\/div>\n<h3>Error handling<\/h3>\n<p>When nothing important is in the project, just discard it.<\/p>\n<p>When nothing important is in a costume, just discard it.<\/p>\n<p>When work needs to be restored, click to the &#8216;proceed&#8217;-Button in the error messages. When one error message is away, there are quite a lot new of them might pop up. Always click &#8216;proceed&#8217;.<\/p>\n<p>Then, look for background or sprites where fonts are used. You see it in the thumbnail preview in the costume tab.<\/p>\n<p>&#8216;edit&#8217; these costumes. The editor has problems to start, and you get again many of these popups. <a href=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/pango_002.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-513\" src=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/pango_002.png\" alt=\"pango_002\" width=\"1036\" height=\"817\" \/><\/a><\/p>\n<p><a href=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/pango_003.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-514\" src=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/pango_003.png\" alt=\"pango_003\" width=\"1038\" height=\"819\" \/><\/a><\/p>\n<p>Editor window is displayed slowly, when it is back till you see the title bar of the editor &#8220;Paint Editor&#8221;, drag it around a little bit and the editor window will be redrawn to its usual appearance. Click to the &#8216;font&#8217; button, this is the &#8220;T&#8221;-Button.<\/p>\n<p><a href=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/pango_004.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-515\" src=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/pango_004.png\" alt=\"pango_004\" width=\"1036\" height=\"815\" \/><\/a><\/p>\n<p>You see\u00a0 &#8216;a ScratchPan..&#8217; in the font selector. Select a font from the selector. This clears the false value in this field. Commit the work with &#8216;ok&#8217;.<\/p>\n<p>The sprite or background is restored. Now go ahead with the workaround procedure.<\/p>\n<h3>Workaround Procedure<\/h3>\n<h4>Completed projects<\/h4>\n<p>If a project is completed, just avoid to save the project when leaving.<\/p>\n<h4>Projects during development<\/h4>\n<p>If the insertion of text is needed to costumes, then<br \/>\n&#8211; finalize the costume\/background as usual.<br \/>\n&#8211; export the costume to a file. Right click on the thumbnail image and &#8216;export this costume&#8217;.<\/p>\n<p><a href=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/pango_007.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-517\" src=\"http:\/\/heppg.de\/ikg\/wordpress\/wp-content\/uploads\/2015\/05\/pango_007.png\" alt=\"pango_007\" width=\"303\" height=\"137\" \/><\/a><\/p>\n<p>Then, use the import function and load this file into the costumes. The difference is that this is a bitmap copy, not containing the font. The problem is, that editing the text is no longer possible.<br \/>\nDelete the costume with the font.<\/p>\n<h3>\u00a0Comments<\/h3>\n<p>There is also an error report on raspberrypi-Forum. Leave a comment there.<\/p>\n<p><a href=\"https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?f=77&amp;t=110812\">RaspberrPi forum<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Remark: For raspbian &#8216;jessie&#8217; and scratch &#8220;Scratch 1.4 (linux) of 2015-09-15&#8221;, this problem is solved. In scratch &#8220;Scratch 1.4 of 14-Jan-15&#8221;, as provided in raspbian for Raspberry Pi, there is a serious bug which prevents projects from loading. This affects scratch projects which are stored\/reloaded multiple times, and only scratch projects which use texts in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-511","post","type-post","status-publish","format-standard","hentry","category-scratch"],"_links":{"self":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=511"}],"version-history":[{"count":7,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/511\/revisions"}],"predecessor-version":[{"id":662,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/511\/revisions\/662"}],"wp:attachment":[{"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=511"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=511"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/heppg.de\/ikg\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}