typographic | Easy SCSS or Stylus responsive typography | Theme library
kandi X-RAY | typographic Summary
kandi X-RAY | typographic Summary
Typographic is responsive typography made easy. Pick a few font stacks, set a few settings, and you've got beautiful responsive typography - it's that easy.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of typographic
typographic Key Features
typographic Examples and Code Snippets
Community Discussions
Trending Discussions on typographic
QUESTION
I'm trying to replicate a report using RMarkdown/LaTeX. Is it possible to add a letterhead to the top of a page in a similar way to the image I've attached? Hoping to find a solution where I can have a letterhead with a logo in it (and where I can easily customise the text and color of the letterhead too).
TIA
I'm using the standard article
document class. Here is my YAML in RMarkdown
ANSWER
Answered 2021-Apr-08 at 08:56To give you something to start with, you can use fancyhdr
and tikz
to design your own header:
QUESTION
I am trying to create a blog using Sanity Headless CMS and React for the frontend.
I have made a decorator for highlighting text. As you can see in the image below, in the editor, the highlighted text has yellow background color. However, I don't see the yellow highlighting in my React frontend.
The code snippets are as follows: sanityblog/schemas/blockContent.js
...ANSWER
Answered 2021-Apr-05 at 10:36You need to serialize the data.
You already do this for the code editor window, in your current serializer you say "if the type is code, run this component".
You need to do this for the syntax highlighter too, maybe something like this could work (have not tested this)
QUESTION
I am learning to build a blog using Sanity CMS and React. I am new to Sanity.
I should be able to insert code snippets in my blog posts. So, I have installed the code-input
plugin.
According to the link here, after I install the plugin I have to use the following code in my schema types. I have no idea where do I insert the code.
Please help.
My folder structure is as follows:
sanityblog/blockContent.js
...ANSWER
Answered 2021-Apr-02 at 11:30If you installed the plugin correctly, it's now available as a schema type to be used in any of your other schemas. So, to answer your question, you can put that code anywhere you want code blocks in your Sanity studio. I'd strongly suggest going over the content modelling documentation 😉
Specifically to your question, assuming you use the sanityBlog/blockContent.js
field for the content of your posts, you can add it there. Here's how that would look like:
QUESTION
I am struggling to figure out how to plot two transform()
(dlookr library) plots together nicely in R Markdown. The following code results in the output from the picture included with this post. I want the last plot (2x2) and am wondering why the other two are populating as well. How can I only print the last one in Markdown?
ANSWER
Answered 2021-Mar-10 at 04:05The first two plots can be avoided by wrapping each plot in a function
call inside as.grob
, and then passing these variables to grid.arrange
.
QUESTION
Typographically, italic type is used, among other uses, to mark up foreign language text:
The Roman soldier pointed his pilum at me.
In the HTML/XHTML/XML code of an EPUB, should the -Tag contain a language attribute? Here is a simplified example:
...ANSWER
Answered 2021-Mar-04 at 16:11From a link in the Sigil forums I actually found an explicit recommendation by the IDPF to mark up foreign passages in that way. The example they give contains the following code, where a French passage is marked up in containing English text:
QUESTION
I'm stucked with a problem with z-index and stacking context. I created link absoluted positioned on a image but the links aren't clickable. If I remove position:relative;z-index:-10
in the first rule in the code my problem is resolved but in this way comes broken an other component, a menu that overlaps, and would fall under if you lifted this rule. Thus not eliminating that rule in the main, how can I resolve the problem?
(In my code there are a lot of simplifications in some parts)
ANSWER
Answered 2021-Feb-09 at 03:25So you will still need to remove the z-index you've got here, and to make sure the menu will go on top of this make sure the menu has a position that isn't static (i.e. relative, absolute, etc.). Then you should be able to increase that menu's z-index to keep it above the slideshow.
QUESTION
My actual code is dense, so I'm trying to reduce this to a minimal example.
I have MainUI.js which contains:
...ANSWER
Answered 2020-Dec-02 at 23:37Make sure that the MainUI.js
script
is referenced correctly and that it is referenced prior to the test.js
script
that will use it.
QUESTION
Is it possible to achieve this in CSS:
I'd like to keep a Typographic hierarchy in my document. I'd like to change dynamically the size (keeping a ratio) of my Headings depending on the font-size of my body in px.
Let's say I want my Headings and body size to keep in sync between each other and change depending on body's font-size in px. If the size of body's font-size increases/decreases the Headings h1,h2,h3 also follow and keep a ratio.
is this something doable in CSS alone?
...ANSWER
Answered 2020-Nov-28 at 15:22The question asks how to make sure all font sizes in a document change proportional to the size set in the body element.
If you set a definite size in the body and thereafter use the em unit to size your fonts you will find that everything changes proportionally.
BUT be aware that the em unit is itself a relative unit. That is actually probably what you want, but just make sure. Consider this example. The div which is a child of the h1 element has a font size proportional to the h1's font size which is itself proportional to its parent's (body element) font size. The div which is not a child of h1, only of the body element has a font size proportional only to the body's font size. See snippet below.
There is another unit, rem (root em) which is set in the html eleme
nt of the document. Most browsers set the basic font size o 16px there and thus that is what 1rem is. You can change that and set for example our body font size in terms of rem. The main reason for doing that would be to acknowledge that the user can change the basic setting in their browser, perhaps they hope that all text will then become automatically bigger, so it is considerate to set your body font size in terms of rem.
To make the arithmetic of this easier, set
QUESTION
I am trying to figure out a way to calculate the baseline of a font at any given font size for typographical animations and noticed something extremely bizarre: For some reason the height value of elements increases in a seemingly arbitrary way when their position is changed to absolute.
Heights without Position Absolute (click to console log heights)
...ANSWER
Answered 2020-Oct-08 at 00:56The trick is within the display and you won't find any logical relation between the height you are getting because in both cases the calculation is different.
In the first case, you have inline element and this rule apply:
The 'height' property does not apply. The height of the content area should be based on the font, but this specification does not specify how. A UA may, e.g., use the em-box or the maximum ascender and descender of the font. (The latter would ensure that glyphs with parts above or below the em-box still fall within the content area, but leads to differently sized boxes for different fonts; the former would ensure authors can control background styling relative to the 'line-height', but leads to glyphs painting outside their content area.)
The vertical padding, border and margin of an inline, non-replaced box start at the top and bottom of the content area, and has nothing to do with the 'line-height'. But only the 'line-height' is used when calculating the height of the line box.ref
So the height of your span depends only on the font properties (font-family, font-size, etc) + the border top/bottom. You cannot find how the height is calculated exactly unless you dig into the font properties which is a difficult exercise especially if we deal with the default font that differ a from browser to another (and from OS to another).
Related:
Can specific text character change the line height?
In the second case, you span is now a block element because you made it position:absolute
so you need to follow the rule detailed here: https://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height that will lead us to use the following rule: https://www.w3.org/TR/CSS21/visudet.html#root-height
If it only has inline-level children, the height is the distance between the top of the topmost line box and the bottom of the bottommost line box
So the height of our element is now the height of the line box which is defined by line-height
(like detailed here: https://www.w3.org/TR/CSS21/visudet.html#line-height). Not only line-height but also vertical alignment of the elements inside but in your case you don't have this complexity since you have only one character
The default line-height
is defined by the browser but if you fix it you will get the height you want:
QUESTION
I'm using a custom font and somehow the rendering screws up the line height, potentially because of misconfigured descent
or leading
(?), so that g's and j's are cut off in the last line of the rendered text. I think it might be a problem with this particular font, because Sketch is also exposing similar issues with the font in question, but I feel like I don't understand quite enough about typographic measurements or fonts. I found this Apple documentation page on Typographic Concepts quite insightful.
I looked into the font itself with the test version of FontLab, which I have used for the first time btw - so I've little clue really what I'm looking at. It does seem like the g is going below the configured descent
, which seems to be what the last line is. (?) (See: Character view in FontLab, showing the descend of the g)
Via lineSpacing
I could adjust the distance between just the lines itself to fix this in the first few lines. I know iOS 14 is going to bring a way to modify the leading
of a Text
in SwiftUI. But I need to target iOS 13, so that doesn't help.
I've also tried SwiftUI's Text
, a normal UILabel.text
and UILabel.attributedText
with a customized paragraph style, but nothing I adjust there seems to mitigate the problem.
The view is not even clipping. Just adding padding to the frame does not help at all. It increases the distance, but the g's and j's are still cut.
What can I do? Subclass UILabel
and overwrite the intrinsicContentSize
to add some extra space, when there is a g and j in the last line? That feels a) dirty and b) given that padding didn't help, it might not fix the problem?
Is the font itself the problem here? Can I patch the font somehow without making it worse?
Is there any way to modify the leading or the descend height of the font, when I use lower level APIs? Seems like I could go down to CoreText, as CTFontCreateCopyWithAttributes(_:_:_:_:)
is a candidate, if I could just modify via attributes the leading, line space or the descend? Can or monkey-patch / swizzle things without shooting myself in the knee? Should I just file a radar a feedback?
ANSWER
Answered 2020-Sep-23 at 15:52You need to use NSAttributedString
instead of String to control the line spacing of UILabel. Here is sample code
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install typographic
@import Typographic somewhere in your stylesheet
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page