Mpdf - How to set font size before writeCell? - mpdf

I want to highlight the fact that I am using programmatically mPdf to do some specific writeText / writeCell, etc..
I need to simply increase font size when writing a specific text. Only for this.
How?

There is actually a public method for that, named SetFont. The problem with it is that it is completely undocumented, so it is unclear whether you’re actually supposed to use it, or it’s just an unstable implementation detail.
The documented API to accomplish this is to specify fonts and all other formatting information using HTML/CSS and then use the WriteHTML or WriteFixedPosHTML method to pass that to the mPDF library.

Related

Making NSSegmentedControl segments accessible

My AppKit app's NSSegmentedControl doesn't show any labels in the Accessibility Inspector, meaning that disabled users won't be able to use assistive devices to interact with them. Calling setAccessibilityLabel and setAccessibilitySelected on the segment controls has no effect.
Similar advice on the topic (e.g., Disable / hide accessibility element) says to use accessibilitySetOverrideValue, which does work, but it is deprecated:
accessibilitySetOverrideValue(_:forAttribute:)' was deprecated in macOS 10.10: Use the NSAccessibility protocol methods instead (see NSAccessibilityProtocols.h)
The Apple docs at https://developer.apple.com/documentation/objectivec/nsobject/1535843-accessibilitysetoverridevalue read:
This method is deprecated. Use the new method-based API instead. For more information, see Accessibility Programming Guide for OS X or NSAccessibilityProtocol.
However, there doesn't seem to be any equivalent method to override an accessibility value. How can I accomplish this without using deprecated methods?
NSSegmentedControl will pick up the accessibilityDescription of the image. So the solution I used was to ensure all my segmented controls have images, and for each one, if necessary, make a copy of the image, set the accessibilityDescription explicitly, and reset the image.
Ugly, but better than any other solution I found.

How to write a firefox plugin that automatically changes page layout?

I was wondering if you can give me any pointers on how to write a firefox plugin/add-on, that would change the layout of the page one is on, based on a pre- written CSS file.
It's meant as a prototype and what I want to be able to do initially is to make my browser automatically change the background color of certain div's, when I navigate to the chosen page. I'm only trying to make it work for a couple of sites.
I speak python, javascript/jquery, css, html ..
You may be able to accomplish your goal using the Stylish addon without writing your own. This basically allow you to attach custom CSS overrides based on a URL pattern.
If you want to do this and write your own extension, you could use the addon-sdk and make use of page-mod. Here is a tutorial that will help you with running the script only on the URL's you specify. As of FireFox 34 you should be able to attach actual CSS files instead of having to rely on JavaScript. Learning the addon-sdk it a lot less intimidating than making an old style / low-level extension and should be sufficient for your needs.
There are a few different ways to accomplish similar things, so you will need to experiment based on your needs.

Which is the best approch to add styles to SPA?

I am using insert-CSS node module for adding styles to DOM, internally this adds the embedded approach.
so far my understanding is using external style sheets is best way to do it. But while using insert CSS, css added to the js bundle and dynamically css embedded to the . so this also looks as same using external CSS.. and css will be cached with js and there will be one file(js+css) we can avoid one http request for loading CSS ?
I feel this insert-css is better than traditional approach(external css) am i correct? please suggest me your thought on the same and add some docs to refer.
so my question is which is the best approach among using "insert-css npm" or "external css"
I didn't find useful info on this question and sharing my experience.
My personal recommendation is not to use "insert-css" modules for the simple projects like dealing with forms and minimal amount of components.
"insert-css" - as mentioned above, "insert-css" add the embedded styles, in the network, its passed as base64 format. Though it's less weight in the network, browser needs to convert the base64 format to css and adds the embedded css, this conversion process will happen allays in js side, I guess which will cause the performance issues

Best practices for identifiers/classes names in browser extensions

In extensions (I'm praticularly focused on Chrome's extensions), css identifiers and classes injected in a page may enter in conflict with other elements on the page.
I'm trying to define their name with an extension prefix, but it's not perfectly sure. So, is there a way to define scurely names of css ids/classes?
It's not possible if "perfectly sure" is your requirement. Someone could always download your extension, look at the classnames you're using, then change their website's CSS to conflict with (or more likely attempt to override) your classnames. This is a feature, not a bug; extensions extend web pages, so they're supposed to be able to commingle with and alter their DOMs.
If you wanted to invent a system where others would not intentionally conflict with yours, why not use the Java namespace scheme: take a domain you own, and use it as a prefix, like com-example-myclassname? Slightly less readable and no more secure would be either the ID of your extension or a randomly generated SHA-1 hexcoded hash:
abcdefghijklmnop-myclassname
da39a3ee5e6b4b0d3255bfef95601890afd80709-myclassname
I'm intentionally not including dynamic solutions here because CSS typically isn't dynamic in a Chrome extension or app. Moreover, CSP would probably make this approach anything but straightforward (which is a good thing).

How do I format the card in Google Fusion Tables so that the text/images appear in multiple columns

I've been trying to separate the text/images into columns using normal CSS script, but they are not recognized by the google custom card interface. I've noticed that all the commands are a little different stylistically from CSS, though derived from that language as far as I can tell. I've tried looking for some general reference material on this google variant to solve this issue, but so far have not had any luck. Any suggestions?
The card layouts do use standard CSS. We strip out anything that might be a security risk, but it's unlikely you're encountering that. Can you include a link to your table and an example of the CSS you think should be working but is not?
If you'd rather not make your table accessible you can send mail to googletables-feedback#google.com and we can pick up the conversation from there.

Resources