Formating text in react-bootstrap Card.Text - formatting

I can't seem to workout how to format text within a react-bootstrap Card. I've tried many different things and read many articles all of which don't work.
The problem is that the text I put into my Card.text element is centred. I want to justify or left justify it. Here's a code snippet that is centred....
<Card.Text>
This is some sample text. It appears centred which seems to be the default style.
</Card.Text>
It seems that I can apply a class using the boostrap css. I've used the 'lead' class and it does indeed apply the style as expected.
<Card.Text class='lead'>
This is some sample text. It still appears centred and applies the lead style as expected.
</Card.Text>
When I use the text-justify class it has no effect whatsoever
<Card.Text class='text-justify'>
This is some sample text. It still appears centred and applies the lead style as expected.
</Card.Text>
I'm not sure if I'm missing something here. There are no useful instructions on the react-bootstrap docs site. If somebody could point me in the right direction I'd be very grateful.

Try <Card.Text className="text-start">Nunc malesuada eget est fringilla dapibus.</Card.Text>
This should align text to left (text-center - in center, and text-end - to the right).
Use className in React instead of class.

Related

Single feature highlight on hover

map.js :
https://github.com/ro-hit81/COVID-19-Vuetify/blob/master/src/assets/map.js
timeline.vue:
https://github.com/ro-hit81/COVID-19-Vuetify/blob/master/src/views/Timeline.vue
Actually it is going to be a confusing query I guess and it might get difficult for me to make my problem understandable. I am actually using 'Vue js' and 'Echarts js' to create a Map of my country with some temporal point data. The problem may be minor but I am not able to figure out to solve.
While importing China.json file in my .js file, I can see 'Province' is highlighted on hover as:
Now, without changing any code, only importing Nepal.json file inplace of China.json, I see whole layer is highlighted on hover.
I want single feature (as in 'Province' in case of China data , similarly 'District' in case of Nepal data) to be highlighted on hover.
I tried my best to make this problem understandable. Please tell me kindly if i have to attach code.

sidebar width too short to display datetimepicker

How can i solve this situation?
Assuming you are using Apache Isis 1.17.0, take a look at
wicket/wicket/resource/org.apache.isis.viewer.wicket.ui.pages.SidebarCssResourceReference/simple-sidebar-ver-1582544091730.css
and try to modify values for padding / margin. Eventually you need to override settings in application.css; sometimes you may need to use '!important'
If you are using Chrome, press <Ctrl>-<Shift>-C and select the date-time widget.
If you can provide sample code, I could take a closer look.

UILables, Text Flow and Layouts

Consider the following, I have paragraph data being sent to a view which needs to be placed over a background image, which has at the top and the bottom, fixed elements (fig1)
Fig1.
My thought was to split this into 4 labels (Fig1.example2) my question here is how I can get the text to flow through labels 1 - 4 given that label 1,2 & 3 ar of fixed height. I assumed here that label 3 should be populated prior to 4 hence the layout in the attached diagram.
Can someone suggest the best way of doing this with maybe an example?
Thanks
Wish I could help more, but I think I can at least point you in the right direction.
First, your idea seems very possible, but would involve lots of calculations of text size that would be ugly and might not produce ideal results. The way I see it working is a binary search of testing portions of your string with sizeWithFont: until you can get the best guess for what the label will fit into that size and still look "right". Then you have to actually break up the string and track it in pieces... just seems wrong.
In iOS 6 (unfortunately doesn't apply to you right now but I'll post it as a potential benefit to others), you could probably use one UILabel and an NSAttributed string. There would be a couple of options to go with here, (I haven't done it so I'm not sure which would be the best) but it seems that if you could format the page with html, you can initialize the attributed string that way.
From the docs:
You can create an attributed string from HTML data using the initialization methods initWithHTML:documentAttributes: and initWithHTML:baseURL:documentAttributes:. The methods return text attributes defined by the HTML as the attributes of the string. They return document-level attributes defined by the HTML, such as paper and margin sizes, by reference to an NSDictionary object, as described in “RTF Files and Attributed Strings.” The methods translate HTML as well as possible into structures of the Cocoa text system, but the Application Kit does not provide complete, true rendering of arbitrary HTML.
An alternative here would be to just use the available attributes, setting line indents and such according to the image size. I haven't worked with attributed strings at this level, so I the best reference would be the developer videos and the programming guide for NSAttributedString. https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/AttributedStrings/AttributedStrings.html#//apple_ref/doc/uid/10000036-BBCCGDBG
For lesser versions of iOS, you'd probably be better off becoming familiar with CoreText. In the end you'll be rewarded with a better looking result, reusability/flexibility, the list goes on. For that, I would start with the CoreText programming guide: https://developer.apple.com/library/mac/#documentation/StringsTextFonts/Conceptual/CoreText_Programming/Introduction/Introduction.html
Maybe someone else can provide some sample code, but I think just looking through the docs will give you less of a headache than trying to calculate 4 labels like that.
EDIT:
I changed the link for CoreText
You have to go with CoreText: create your AttributedString and a CTFramesetter with it.
Then you can get a CTFrame for each of your textboxes and draw it in your graphics context.
https://developer.apple.com/library/mac/#documentation/Carbon/Reference/CTFramesetterRef/Reference/reference.html#//apple_ref/doc/uid/TP40005105
You can also use a UIWebView

Using a <style> definition makes a font unfindable in jasper reports pdf export?

I have a jar I include with my application with some fonts. If I paste around
<font fontName="NimbusSansGlobal Light" size="12" pdfFontName="NimbusSansGlobal Light" pdfEncoding="Identity-H" isPdfEmbedded="true"/>
into all my text elements, PDF output works fine. If I switch them all to use a style which defines the font as such:
<style name="SansFontStyle" isDefault="true" pdfFontName="NimbusSansGlobal Light" pdfEncoding="Identity-H" isPdfEmbedded="true"/>, then the font can't be found by the JRLoader when I try to generate reports. Interesting enough, if I use JRLoader within my application directly, the font is found fine.
Why would styles break PDF export?
Using Font Extensions should solve this problem.
Once you use font extensions, then you can set the font in the text element or in the style. You will not specify pdfFontName, pdfEncoding, or isPdfEmbedded in the report. That gets specified in the font extension.
Note: In a strict interpretation, this doesn't actually answer the question. I have no idea why styles work differently from directly setting the fonts. It seems like a bug, but maybe it's unexpected yet intentional for some reason we aren't thinking of. Therefore, I started to enter this as a comment rather than an answer. But it got too long.
Regardless, this should allow you to use styles as you want to. So I expect that it will solve the heart of the problem.
Font extensions are documented in the JasperReports (and iReport) samples and documentation, so it should be pretty easy to use them once you know that you ought to.

When using pdfpages in LaTeX, how to avoid page breaks before the first page ?

I am creating a large LaTeX document, and my appendix has reproductions of several booklets that I have as PDFs. I am trying to create a section header and then include the pages at a slightly lower scale. For example:
\section{Booklet about Yada Yada Yada}
\includepdf[pages={-}, frame=true, scale=0.8]{booklet_yadayada.pdf}
However, pdfpagex does two annoying things. First, it devotes one output document page for included document page. I can live with that as I am using 80% scale. The main problem, however, is that the first page is also a new page, so I have a page with just a section title, and then a separate page with the booklet.
Is there some way to get pdfpages to be a little smarter here?
\includepdf uses \includegraphics internally, so something like
\section{Foo}
\fbox{\includegraphics[page=1,scale=0.8]{foo.pdf}}
would include the page without starting a new one, although it only does one page at a time.
For me the following worked just fine:
\includepdf[pages=1,pagecommand=\section{Section Heading}]{testpdf}
\includepdf[pages=2-,pagecommand={}]{testpdf}
I tried this solution too, but \includepdf keeps the advantage of outputting the file over the margin (the output is centered from the edges of the page).
So I openned pdfpages.sty, and I searched for \newpage command. I deleted the first occurance (line 326), just to try, and after saving then compiling again, there were no page break anymore.
Use the minipage environement :
\chapter*{Sujet du stage}
%\fbox{
\begin{minipage}{\textwidth}
\includepdf[scale=0.8]{../sujet-stage/main.pdf}
\end{minipage}
It doesn't add any extra page and it works with includepdf.
Thanks for all the answers - I couldn't for the life of me figure out what logic \includepdf uses to insert blank pages; the trick with including the first page via \includegraphics solved most (but not all) of those problems; so here are some notes:
First, out of curiosity, I have also tried to use only \includepdf, but split in two parts:
\includepdf[pages=1]{MYINCLDOC.pdf}
\includepdf[pages=2-last]{MYINCLDOC.pdf}
... unfortunately, this has the same problem as the question in OP.
Since #WASE's answer, there are now multiple \newpages in the source (pdfpages.sty). I tried reading the source, but I found it quite difficult; so I tried temporarily setting \newpage to \relax only for \includepdf - and that puts all pages in the document on top of each other; so probably not a good idea to get rid of \newpage blindly.
Just \includegraphics[page=1,scale=0.8]{foo.pdf} works - but (as #WASE also note) it is aligned at the top-left corner of the page body, which is to say inside the margins; for a full page we'd want the pdf inclusion overlaid over the whole page, margins included.
This page: graphics - How do I add an image in the upper, left-hand corner using TikZ and graphicx - TeX - LaTeX points to several possibilities for positioning on page over the margins; but for me, the best solution for a full page PDF inclusion is to use package tikz to center it to the page:
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center) {\includegraphics[page=1]{MYINCLDOC.pdf}};
\end{tikzpicture}
\includepdf[pages=2-last]{MYINCLDOC.pdf}
After this is done, as a bonus, I have also experienced:
Proper targets of PDF bookmarks (going to the right page when clicked)
If you use package pax, the data seems to be included also for the \includegraphics standalone first page, so no difference there
If you have a twoside document - pdfpages, with the above split of the first page in \includegraphics, will now (seemingly) correctly insert the equivalent of \cleardoublepages between pdfs that are included back to back (so I don't have to insert such a command manually).
Hope this helps someone,
Cheers!
I'm a little late, but the following solution worked for me:
\includepdf[pages={-},angle=90, scale=0.7]{lorem-ipsum.pdf}
All pages are imported, scaled and rotated by 90 degrees.
Works with Texmaker 5.0.4