Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoscale text #20

Open
ghost opened this issue Apr 3, 2018 · 5 comments
Open

autoscale text #20

ghost opened this issue Apr 3, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 3, 2018

Maybe it would be convenient to automatically scale the text in book, speech, think to the available width

adding transform shape from
1a039d7 might be a starting point

ghost pushed a commit that referenced this issue Apr 3, 2018
ghost pushed a commit that referenced this issue Apr 3, 2018
* dev:
  documentation for the tikz library
  Fixed problem with key values "leaking" out
  Backed out  `transform shape` for the moment and opened #20 instead
  moved super duck definition from tikzlibrary to example
  copied stuff from global gitignore over
  reverted back to own gitignore
  Added aliases with spaces.
  Added a .gitignore
  Added a wrapper around \duck@draw to turn it into a pic, seems to work (but could do with more extensive testing - see duck_library.tex for tests).
@VHarisop
Copy link

What is the status of this? Until autoscaling is properly implemented, is there a way to resize speech/thought bubbles manually?

@ghost
Copy link
Author

ghost commented Aug 25, 2018

@VHarisop Thanks a lot for your comment! I'm still unsure what the best course of action is for the scaling of text. On the one hand site automatically scaling looks very convenient, on the other hand I'd like the user to have as many possibilities as possible to choose a suitable font size (which makes the text easier to read at small sizes than just scaling the normal sized text down) and yo apply other text formatting like parboxes or minipages for multiline text.

Here are a few suggestions for manual resizing of the text:

\documentclass{standalone}
\usepackage{tikzducks}

\begin{document}
	
\begin{tikzpicture}
	\duck[speech={Quack!}]
\end{tikzpicture}	
	
\begin{tikzpicture}
	\duck[speech={\tiny Quack!}]
\end{tikzpicture}	

\begin{tikzpicture}
	\duck[speech={\scalebox{0.5}{\tiny Quack! Quack! Quack!}}]
\end{tikzpicture}	

\begin{tikzpicture}
	\duck[speech={\scalebox{0.7}{\parbox{1.7cm}{\vspace*{-0.3cm}\flushleft \tiny Quack! Quack! Quack! Quack!}}}]
\end{tikzpicture}	

	
\end{document}

document

If these suggestions don't work for, please feel free to show a short example what you are trying to do and I'll try to come up with something.

@ghost
Copy link
Author

ghost commented Aug 25, 2018

@VHarisop FYI: your avatar inspired my to draw https://github.com/samcarter8/tikzzoo/blob/master/pingu.tex :)

@VHarisop
Copy link

@samcarter8 Thanks for the quick reply! I think I misspecified my problem: I'm preparing a presentation on beamer, so instead of making the text small I would rather make the speech bubble bigger, so that the text remains visible.

@ghost
Copy link
Author

ghost commented Aug 25, 2018

@VHarisop Oh, for this you could draw the bubbles yourself, they are basically just an ellipse


\documentclass{standalone}
\usepackage{tikzducks}

\begin{document}
	
\begin{tikzpicture}
	\duck[]
  \fill[gray!30!white] (-1.2,1.8) ellipse (1.4 and 0.5);
  \fill[gray!30!white] (-0.2,1.54) -- (0.2,1.35) -- (0.0,1.6) -- cycle;
	\node at (-1.2,1.8) {Quack! Quack!};
\end{tikzpicture}	
	
\end{document}

document

Or you could use the tikz shapes.callouts library:

\documentclass{standalone}
\usepackage{tikzducks}

\usetikzlibrary{shapes.callouts}

\begin{document}
	
\begin{tikzpicture}
	\duck
  \node[ellipse callout, draw,callout relative pointer={(0.5,-0.8)}] at (-0.5,2.5) {Quack! Quack!};
\end{tikzpicture}	
	
\end{document}

document

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant