Skip to content

Commit

Permalink
deploy: a084183
Browse files Browse the repository at this point in the history
  • Loading branch information
noelwelsh committed Aug 4, 2024
1 parent baa0df7 commit 877079c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main.js.map

Large diffs are not rendered by default.

Binary file modified pictures/font.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions pictures/size.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ <h2 id="bounding-box" class="section">Bounding Box</h2>
.</span><span class="identifier">strokeColor</span><span>(</span><span class="type-name">Color</span><span>.</span><span class="identifier">hotpink</span><span>)
.</span><span class="identifier">strokeWidth</span><span>(</span><span class="number-literal">3.0</span><span>)
)
</span><span class="comment">// boundingBox: Picture[FromGifBase64 &amp; Basic &amp; Bitmap &amp; FromBufferedImage &amp; FromPngBase64 &amp; FromJpgBase64, Unit] = doodle.algebra.Picture$$anon$1@3aedadea
</span><span class="comment">// boundingBox: Picture[FromGifBase64 &amp; Basic &amp; Bitmap &amp; FromBufferedImage &amp; FromPngBase64 &amp; FromJpgBase64, Unit] = doodle.algebra.Picture$$anon$1@3e544f0e
</span><span>
</span><span class="keyword">val</span><span> </span><span class="identifier">picture</span><span> = </span><span class="identifier">circle</span><span>.</span><span class="identifier">on</span><span>(</span><span class="identifier">boundingBox</span><span>)
</span><span class="comment">// picture: Picture[Bitmap &amp; FromBufferedImage &amp; FromPngBase64 &amp; FromGifBase64 &amp; Basic &amp; FromJpgBase64, Unit] = doodle.syntax.LayoutSyntax$$anon$1@112af1b5</span></code></pre>
</span><span class="comment">// picture: Picture[Bitmap &amp; FromBufferedImage &amp; FromPngBase64 &amp; FromGifBase64 &amp; Basic &amp; FromJpgBase64, Unit] = doodle.syntax.LayoutSyntax$$anon$1@b8aad6f</span></code></pre>
<p>This produces the picture shown below.</p>
<div class="default-image-block">
<img src="bounding-box.png" alt="A circle with a bounding box" title="A circle with a bounding box">
Expand Down
7 changes: 5 additions & 2 deletions pictures/text.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,20 @@ <h2 id="concept" class="section">Concept</h2>
<img src="hello.png" alt="A picture showing the text Hello from Doodle!" title="Hello from Doodle!">
</div>
<p>In addition to creating pictures containing text, it also allows specifying the <a class="api" href="https://javadoc.io/doc/org.creativescala/doodle-docs_3/latest/doodle/core/Font.html">Font</a> used for the text, via the <code>font</code> method.
In this example we use the default sans-serif font, in bold weight and 24 point size.</p>
In this example we use the default serif font, in bold weight and 24 point size.</p>
<pre><code class="nohighlight"><span class="keyword">import</span><span> </span><span class="identifier">doodle</span><span>.</span><span class="identifier">core</span><span>.</span><span class="identifier">font</span><span>.{</span><span class="type-name">Font</span><span>, </span><span class="type-name">FontSize</span><span>}

</span><span class="keyword">val</span><span> </span><span class="identifier">font</span><span> =
</span><span class="type-name">Picture</span><span>
.</span><span class="identifier">text</span><span>(</span><span class="string-literal">&quot;Change the font&quot;</span><span>)
.</span><span class="identifier">font</span><span>(</span><span class="type-name">Font</span><span>.</span><span class="identifier">defaultSansSerif</span><span>.</span><span class="identifier">bold</span><span>.</span><span class="identifier">size</span><span>(</span><span class="type-name">FontSize</span><span>.</span><span class="identifier">points</span><span>(</span><span class="number-literal">24</span><span>)))</span></code></pre>
.</span><span class="identifier">font</span><span>(</span><span class="type-name">Font</span><span>.</span><span class="identifier">defaultSerif</span><span>.</span><span class="identifier">bold</span><span>.</span><span class="identifier">size</span><span>(</span><span class="type-name">FontSize</span><span>.</span><span class="identifier">points</span><span>(</span><span class="number-literal">24</span><span>)))</span></code></pre>
<p>This produces the picture below.</p>
<div class="default-image-block">
<img src="font.png" alt="A picture showing the text Change the font" title="Change the font">
</div>

<h2 id="implementation" class="section">Implementation</h2>
<p>These methods are available on both the <a class="api" href="https://javadoc.io/doc/org.creativescala/doodle-docs_3/latest/doodle/algebra/Text.html">Text</a> algebra and <a class="api" href="https://javadoc.io/doc/org.creativescala/doodle-docs_3/latest/doodle/image/Image.html">Image</a>.</p>
<p class="nextPage"><a href="drawing.html">Drawing to the Screen→</a></p>
</main>
<footer>Creative Scala is copyright Noel Welsh</footer>
Expand Down

0 comments on commit 877079c

Please sign in to comment.