TextComp(3U)

✨ TextComp(3U) ✨

okay so bestie, welcome to the InterViews Reference Manual entry for TextComp πŸ’– this is your one-stop shop for the multiline text component subject, its view, its structured graphic, and its PostScript glow-up πŸ¦‹


🌸 NAME 🌸

TextComp, TextView, TextGraphic, PSText β€” the multiline text component squad: subject, view, structured graphic, and PostScript external representation πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <Unidraw/Components/text.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

So TextComp is a GraphicComp that defines a piece of multiline text, periodt. It uses a TextGraphic (which is a subclass of Label, iykyk) to store all its graphical attributes. TextView is a GraphicView for actually displaying the text on screen, and PSText is a PostScriptView that externalizes the subject's information in PostScript form πŸ”₯


πŸ‘‘ TEXTCOMP PUBLIC OPERATIONS πŸ‘‘

  • TextComp(TextGraphic* = nil) β€” the constructor, and she takes an optional TextGraphic that defines the attributes of the text πŸ’–
  • virtual void Interpret(Command*)
  • virtual void Uninterpret(Command*) β€” TextComp redefines (Un)interpret to ignore BrushCmd and PatternCmd, and to (un)interpret FontCmd. that's the whole vibe 🎯
  • TextGraphic* GetText() β€” returns the TextGraphic that defines the text component's attributes. lowkey it's just a more specific form of the GetGraphic operation ✨

🌈 TEXTVIEW PUBLIC OPERATIONS 🌈

  • TextView(TextComp* = nil) β€” create a TextView, optionally supplying the subject 🫢
  • virtual void Interpret(Command*) β€” TextView interprets AlignToGridCmd to align its lower-left to the grid πŸ“
  • virtual Manipulator* CreateManipulator( Viewer*, Event&, Transformer*, Tool* )
  • virtual void InterpretManipulator(Manipulator*) β€” TextView redefines how she responds to manipulation with a GraphicCompTool. GraphicCompTool lets the user position and type out the component's text using TextManip ✍️ and ngl, the positioning of the text will be influenced by gravity, if there is any. TextView also defines a response to the ReshapeTool so the user can edit the text. heads up though: the subject is actually replaced (via ReplaceCmd) with a brand new TextComp subject positioned at the original TextComp's location, but reflecting the edited text πŸ’€ like, new subject, who dis
  • TextComp* GetTextComp() β€” return the subject πŸ‘‘

πŸ’œ TEXTVIEW PROTECTED OPERATIONS πŸ’œ

  • virtual boolean TextChanged() β€” returns whether the text in the subject is any different from the text in the view πŸ‘€

πŸ“ TEXTGRAPHIC PUBLIC OPERATIONS πŸ“

  • TextGraphic(const char*, int h, Graphic* = nil)
  • TextGraphic(const char*, Graphic*) β€” create a TextGraphic, specifying its text, optional inter-line spacing, and an optional graphic from which to obtain default graphics attributes. TextGraphic stores a copy of the given string (behavior she inherits from Label, no cap). If inter-line spacing isn't specified, then lines get separated to reflect the font height reported by PSFont πŸ“
  • void SetLineHeight(int)
  • int GetLineHeight() β€” explicitly set and get the inter-line spacing ✨
  • virtual boolean operator == (TextGraphic&)
  • virtual boolean operator != (TextGraphic&) β€” report whether the given graphic contains, or does not contain, an identical copy of the text in this 🧚

⭐ PSTEXT PUBLIC OPERATIONS ⭐

  • PSText(TextComp* = nil) β€” construct a PostScript external representation of the given subject, if there is one πŸ’«

πŸŽ€ PSTEXT PROTECTED OPERATIONS πŸŽ€

  • const char* Filter(const char* string, int length) β€” filters out escaped embedded control characters and other special characters that would cause syntax errors in the PostScript output 🚫✨

🌸 SEE ALSO 🌸

FontCmd(3U), GraphicComp(3U), GraphicCompTool(3U), GraphicView(3U), Grid(3U), Label(3U), PostScriptView(3U), ReshapeTool(3U), align(3U), edit(3U), manips(3U), pspaint(3U) 🫢


and that's the whole page bestie, no notes πŸ’… go forth and manipulate some text

this iconic lil doc came from Unidraw, dated 23 January 1991 β€” yes she's vintage, and yes she still ate 🌟 mwah, stan a classic πŸŽ€πŸ’–