Renamed to michaelmesser/elm-collage. That is where the repository lives now. It has not been published as a package under the new name.
Versions published as 2426021684/elm-collage still install under that name. 2 versions of 3 come from the new location (see their notes). 1 version could not be recovered and cannot be installed.
Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/michaelmesser/elm-collage.
What we checked: The repo moved to github.com/michaelmesser/elm-collage. Rebuilt with git archive from commit 020c931a239a of https://github.com/michaelmesser/elm-collage (zip prefix 2426021684-elm-collage-da87c20/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 6b376dc246549b4beabe34c1cc544fd1ed5bd5a5.
The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.
Details · package.elm-lang.org's zip: https://github.com/2426021684/elm-collage/zipball/1.0.2/
A library for styling and displaying text.
While the String library focuses on representing and manipulating strings of characters, the Text library focuses on how those strings should look on screen. It lets you make text bold or italic, set the typeface, set the text size, etc.
Be aware that this module is intended for small chunks of text on one line. Using a newline character in a text chunk will simply have no effect. Alignment and placement should be done using the Collage or Layout modules.
To add some text to your collages, follow the next steps:
fromString.Collage.rendered.
From this point, you cannot style your text any more.
What you can do however is...So the most important thing to remember is that after you have turned your text into a collage, you cannot style it anymore!
Note: Function and type names in this module clash with those from Collage and Collage.Layout. Best way to use is a qualified import like:
import Collage.Text as Text exposing (Text, fromString)Convert a string into text which can be styled and displayed.
To show the string "Hello World!" on screen in large, dark red, italics, you could say:
fromString "Hello World!"
|> size large
|> color Color.darkRed
|> shape Italic
|> Collage.renderedText with nothing in it.
empty = fromString ""Possible typefaces for text.
Serif, Sansserif, and Monospace correspond to the default browser fonts of the user.
Use Font to specify a concrete typeface.
Set the typeface of some text.
fromString "Text in my favorite font"
|> typeface (Font "Lato")Set the color of some text.
Use the Color module to specify colors.
fromString "Nice blue text"
|> color Color.blueThe predefined font sizes below are spaced sqrt (sqrt 2) of each other.
which gives a balanced view.
This idea is bluntly stolen from LaTeX,
which does something quite similar.
Off course, you can always specify your own font size explicitly.
Set the size of some text.
fromString "Big text"
|> size huge11 px
13 px
16 px
19 px
23 px
27 px
Possible shapes for a piece of text.
Possible weights for a piece of text.
Styles for lines on or over some text.
Put lines on text.
This allows you to add an underline, an overline, or strike out text:
line None (fromString "normal text")
line Under (fromString "underline")
line Over (fromString "overline")
line Through (fromString "strike out")Specifies the styling (color, typeface, weight, etc.) of text.
Give some text a predefined style.
For example, if you design a style called heading that is specifically for heading text,
you could apply it to text like this:
heading =
{ typeface = Sansserif
, size = huge
, color = Color.darkBlue
, shape = Upright
, weight = Bold
, line = Nothing
}
fromString "Welcome to Elm Collage!"
|> style headingPlain black text.
It uses the browsers default typeface and text height. No decorations are used.
defaultStyle =
{ typeface = Sansserif
, size = normal
, color = Color.black
, shape = Upright
, weight = Regular
, line = None
}The width of the text when displayed on the user screen.
The height of the text when displayed on the user screen.
This is equal to the text size:
fromString "Hello World!"
|> size 16
|> height
== 16(Now you know why newlines are a bad idea...)
Opaque type representing styled text.