Method for Adaptive Cards with Variable Height Text in Sketch - symbols

Has anyone managed to pin down a method for creating cards in Sketch which will play well with adaptive height text overrides? For example, a simple card with a thumbnail, title and excerpt might have a title which is 1, 2 or 3 lines and an excerpt which is anything between 6 and 12+ lines. I'd like to know how to position the excerpt relative to the new height of the title but it seems not to interpret the new three-line height, only it's original height in the symbol. See attached for illustration.
Methods that I've tried include pinning the excerpt to the bottom but that doesn't play well with the variable length of the excerpt and grouping the title and the thumbnail. The only working method that I have is creating three instances of the symbol called post-title-one-line, post-title-two-line, post-title-three-line – which seems clunky.
Looking for any ideas or direction to a solution.

My recommendation is to use the Auto-Layout by Anima plugin. Follow the documentation and examples provided to learn how to use it. Here's an example solution:
Screenshot of Sketch File
Example Sketch File

Related

google spreadsheets(google excel) Why is my picture being displayed incorrectly in Html View?

Whenever I add a picture to google spreadsheets in editor mode It always appears lower when viewed in Html Mode. Is their a fix for this?
You can instruct Google Spreadsheet engine with ease how you want the images to render by using this syntax:
To retain aspect ratio while increasing / decreasing the cell size:
=IMAGE("URL")
To make the image stretch and fit all edges of the cell:
=IMAGE("URL",2)
To make the image keep its original size:
=IMAGE("URL",3)
To manually set the image size (replace 50,50 with desired dimensions):
=IMAGE("URL",4,50,50)
Now to answer your question more directly. There are several reasons why this can happen. This comes to how Google are actually translating the spreadsheet and rendering it as HTML.
With that said, it is hard to answer your question with the correct answer while not being able to look at the spreadsheet and the output of the html.
Update
Looking at your source:
The problem is that the CSS that is outputted generates topå and left values that makes the image be off by the y axiz.
Here is a method to edit the CSS in Google Spreadsheet if you are familiar with it: http://lifehacker.com/387849/style-your-google-docs-with-css
If you are not familiar with it its probably not much help, but anyway!
If you find this answer helpful please tick accept and up it, i need it :-)

howto draw a text with alignment centered in simpliest way. (ios , swift)

I would like to draw a text in my custom view at point X,Y with center allignment. In case the text would be "SUGUS", I expect to have the Character G at Point X,Y.
I tried several things with NSString.drawinRect(), where I have to provide the width of the text, which has to be measured first depending on the Fonttype. It worked, but for me thats not a straightforward solution.
I purposely did not add code here, because a first try with code was misleading and I hope someone can help me with a clean simple solution ?

Core Text: Drop caps + paragraph styles: Incompatible?

I'm attempting to draw a richly laid out text view on iPhone that features:
Custom paragraph spacing (kCTParagraphStyleSpecifierParagraphSpacing)
Custom paragraph first-line indentation (kCTParagraphStyleSpecifierFirstLineHeadIndent)
Justified alignment (kCTParagraphStyleSpecifierAlignment)
Finally, a drop cap on my first paragraph
I'm using OHAttributedLabel. The first three points I achieved without much trouble by just setting some paragraph style attributes on my NSAttributedString.
The drop cap I managed to implement by hacking OHAttributedLabel:
Cut out a rectangular region out of the main paragraph's CGMutablePathRef the size of the drop cap by adding an extra CGPathAddRect, as detailed in this excellent blog post.
Drawing the large character in this region with an extra CTFrameDraw call.
My problem: The paragraph styles and the custom text path are incompatible. When I cut a rectangular chunk out of the main text's path, all the paragraph styles seem to get thrown away.
Does anyone know a way to make them work together? Or can anyone think of another way to implement drop caps? (Short of using a UIWebView + CSS, which I'd rather not have the overhead of!)
Thanks!
You can use straight Core Text to achieve this, in the following post I explain the use of 2 framesetters to lay out text with drop caps in a UIView. In the code example (there's also a link to a github repo) you'll be able to see where the paragraph styles are created and applied to the main text view.
https://stackoverflow.com/a/14639864/1218605

How to adjust the width of a font using the Uniscribe API

Please bear with me, I am new to Uniscribe so I hope this isn't a dumb question but I have been unable to find the solution anywhere else. So, here goes...
I am trying to use the Uniscribe API to reduce the width of a font; that is, given a specific font of a particular height, I would like to be able to reduce the width of each character (and all the relevant spacings) by some user-defined percentage.
I have successfully achieved this without calling any Uniscribe functions by obtaining a LOGFONT structure for the current font and adjusting the lfWidth field to be a percentage of its original value. I realise that this is just an average character width but it seemed to have the desired result.
However, when I try to do the same thing using Uniscribe I've noticed that the lfWidth field gets reset to 0 following calls to ScriptShape(). As a result, all rendered text is output using its original width. I'm at a loss to explain why this is or what to do to get around it.
Does anybody have any idea if it's even possible to do what I am trying to do?
You might want to start here (look at the Generate Glyph Information Section), then lead to this.
Hope it helps!

dealing with large figures in Latex

I have a large figure that appears at the end of my document rather than in the section that I want to be in. Even \begin{figure}[h] doesn't help. Without scaling it down, how can I put it at the end of the section I want it in?
Using the afterpage package can be a good solution. However, using the option here you are trying to tell LaTeX where you want to put the image. Instead, you need to tell LaTeX where the image is good to be put:
use \begin{figure}[tb] for figures that fit well in a page with text (say, half of the text height for the figure and the other half for the text)
use \begin{figure}[p] for floats large enough to require a dedicated page.
Setting a proper option increase your chances to have the image almost where you want, having at the same time a good page layout.
If the figure is still too far from the page where it should be placed, you can set some "barriers" for floats positioning with the packages placeins or afterpage (already mentioned).
Here is a small tutorial for float placement. The thing you want to do is put an \afterpage{\clearpage} command at the end of the section. This will create an additional page after the current one and place the floats that are left in the queque there. If the float still doesn't get placed, you have to resize it. If you really don't want to resize it and it should fit on the page, then you could try changing the margins and text area temporarily (i.e. just for that one page) and see if that lets the float get placed.
i forget if it's the float or array package that provides this, but,
\begin{figure}[H]
...
\end{figure}
The upper case H will put the figure exactly where it is in your code.

Resources