how to change background color in scite (scintilla) editor - scintilla

In frustration of some breakage, I've nuked my old/ancient
version of Scite, and done a fresh install of Scite.
So, on Windows, I now have 32-bit version 5.1.4.
Three issues:
#1 How/where to change the overall (not file-type specific)
background color, it defaults to WHITE. I'd like to configure it to that light-yellow-ish color. How/where to
do that. (Googling said to change it in the "SciTEGlobal.properties" file, but nothing in there resembles what I'm trying to do. !?!?)
#2: So, specific to HTML files, as I scrolled down thru a file, the background in HTML sections would have this same light-yellowish color, and the JS sections had white background, and I'd like to have something equivalent
to that. (On the defaults I see now, html sections are white, but the JS section are an off-white, but they are
so close to white, that my eye can hardly discern them, unless I tip the laptop's screen back and forth. (Yuck.)
#3: A new behavior I see now, is that there is some scheme for html, that uses different font-sizes for different contexts. While that seems like a worthwhile feature for many, I'd like to go back to what I had before...where
all lines were the same font-size. (And then, how can I specify just one single font-size, for all lines in all file-types.)
TIA...
Dave

Default background color and style can found in SciTEGlobal.properties file
# Global default styles for all languages
# Default
style.*.32=$(font.base)
# Line number
style.*.33=back:#E7E7E7,$(font.base)
To change default background color open SciTEUser.properties file and add following lines
# Global default styles for all languages
# Default
style.*.32=$(font.base),back:#101010,fore:#BBBBDD
# Line number
style.*.33=$(font.base),back:#101010
Note: Editing SciTEUser.properties file for customization is best practice. However this file is stored under %USERPROFILE% folder (in Windows) and customization limited to that machine only. If your SciTE installation is on USB stick (Portable installation) and you want to retain SciTE customization on whichever PC you plugged in then edit SciTEGlobal.properties
To do any changes specific to any language then edit <language>.properties file.
example html.properties for HTML specific customization.

Related

Replacing fonts in Powerpoint view does not replace font

I have a PowerPoint template. When this template was passed off It included some special fonts that I needed to remove because it was throwing warnings when users opened them up.
When I use the "replace fonts" feature it does not remove the font. I deal a lot with the XML properties of these templates because some of the content is generated dynamically when a report is run. I can still see in the slides the font is present
<a:buFont typeface="Poppins"/> the other is <a:buFont typeface="Noto Sans Symbols"/>
Which both appear to be bullet list fonts? There are no lists in the view though...
Removing it from the XML itself is not an option because when I update the template again it will override that and given that doesn't happen often I will have forgotten all about this. I need to fix this in the template so I can then export it out.
I have edited all the text I can see to either Ariel or Calibri but this Poppins font is still in there and I have no idea how to get it out.
Specifics are
Powerpoint version is 16.36
The program is actually Powerpoint for Mac (if that matters)
If anyone solved a similar issue and can give me some direction it would be much appreciated.
The buFont tag means that font is being used for a bullet rather than actual text. Probably a text level somewhere uses a custom bullet specced with this font. Each content or text placeholder can have up to 9 text levels, you may hove to create 9 levels using Home>Indent More to find the right one.
Start with the Slide Master (View>Slide Master>the larger thumbnail at the top). Then check each placeholder on each Layout (smaller thumbnails below the Master). Finally, check each multilevel placeholder on each slide, in case this was added with local formatting.
My go-to technique is to unzip the presentation into the XML files and do a find and replace on them. That's the quickest way to replace fonts, which can be tucked away in all kinds of obscure places in a presentation. On a Mac, this takes a bit of preparation to avoid problems caused by the OS. If you regularly create PowerPoint files, it may be worth it to set this up. Here's my article on this: OOXML Hacking: Editing in macOS. Look for the part about using a USB or network drive that is set to not create hidden .DS_Store files. Then use a text editor like BBEdit to do multi-file find and replace operations on the font name.
I have PowerPoint 16.39 on my MacBook Pro. Try to click on PowerPoint in the upper left. Then Preferences, then the Save icon. At the bottom you'll have Font Embedding. If you un-check this option, it should not save fonts to the template anymore.

Set Different Terminal Background for Each Directory

I seem to recall stumbling across an article on zsh about how it was possible to have different themes (or presumably, different theme settings, for different directories). In other words, you'd be able to do things like set the background color of the terminal to be blue for one directory, black for another, etc. I couldn't find the original article or anything matching what I had in mind.
Is this something that can be done?
I suggest using LS_COLORS, you can select highlighting, emboldening and different colours very quickly and easily.
heres a great tutorial on how to do that;
https://www.howtogeek.com/307899/how-to-change-the-colors-of-directories-and-files-in-the-ls-command/
It is also possible to edit the bash_profiles. script line;
export BASH_IT_THEME="whichever theme you have"
And insert a downloaded theme but this would be for your whole system (as far as I know)

How can I get the original font name of some text using PDFKit?

I wrote a script which parses information from PDF files and outputs it to HTML. It's written in Python, using pdfminer.
On some text segments, the font style can have semantic significance. For instance: bold, italic and color should trigger different behavior. Pdfminer provides scripts with the font name, but not the color, and it has a number of other issues; so I'm working on a Swift version of that program, using Apple's PDFKit, to extract the same features.
I now find that I have the opposite problem. While PDFKit makes it easy to retrieve color, retrieving the original font name seems to be non-obvious. PDFSelection objects have an attributedString property, but for fonts that are not installed on my computer, the NSFont object is Helvetica. Of course, the fonts in question are fairly expensive, and acquiring a copy just for this purpose would be poor form.
Short of dropping to CGPDFContentStream (which is way too big of a hammer for what I want to get), is there a way of getting the original font name? I know in advance what the fonts are going to be, can I use that to my advantage?
PDFKit seems to use the standard font lookup system and then falls back on some default, so this can be resolved by spoofing the font to ensure that PDFKit doesn't need to fall back. Inspecting the document, I was able to identify that it uses the following fonts (referenced with their PostScript name):
"NeoSansIntel"
"NeoSansIntelMedium"
"NeoSansIntel,Italic"
I used a free font creation utility to create dummy fonts with these PostScript names, and I added them to my app bundle. I then used CTFontManagerRegisterFontsForURLs to load these fonts (in the .process scope), and now PDFKit uses these fonts for attributed strings that need them.
Of course, the fonts are bogus and this is useless for rendering. However, it works perfectly for the purpose of identifying text that uses these font.

Change / Add syntax highlighting for a language in Sublime 2/3

I want to change / add syntax highlighting for a language in Sublime 2/3.
For example I want the keyword this colored in JavaScript.
How can I do that?
I know that there is a preference JavaScript File in C:\Program Files\Sublime Text 3\Packages, but I don't know what to change or if I have to create a new JavaScript Preference File somewhere in this folder %APPDATA%\Sublime Text 3.
Syntax highlighting is controlled by the theme you use, accessible through Preferences -> Color Scheme. Themes highlight different keywords, functions, variables, etc. through the use of scopes, which are defined by a series of regular expressions contained in a .tmLanguage file in a language's directory/package. For example, the JavaScript.tmLanguage file assigns the scopes source.js and variable.language.js to the this keyword. Since Sublime Text 3 is using the .sublime-package zip file format to store all the default settings it's not very straightforward to edit the individual files.
Unfortunately, not all themes contain all scopes, so you'll need to play around with different ones to find one that looks good, and gives you the highlighting you're looking for. There are a number of themes that are included with Sublime Text, and many more are available through Package Control, which I highly recommend installing if you haven't already. Make sure you follow the ST3 directions.
As it so happens, I've developed the Neon Color Scheme, available through Package Control, that you might want to take a look at. My main goal, besides trying to make a broad range of languages look as good as possible, was to identify as many different scopes as I could - many more than are included in the standard themes. While the JavaScript language definition isn't as thorough as Python's, for example, Neon still has a lot more diversity than some of the defaults like Monokai or Solarized.
I should note that I used #int3h's Better JavaScript language definition for this image instead of the one that ships with Sublime. It can be installed via Package Control.
UPDATE
Of late I've discovered another JavaScript replacement language definition - JavaScriptNext - ES6 Syntax. It has more scopes than the base JavaScript or even Better JavaScript. It looks like this on the same code:
Also, since I originally wrote this answer, #skuroda has released PackageResourceViewer via Package Control. It allows you to seamlessly view, edit and/or extract parts of or entire .sublime-package packages. So, if you choose, you can directly edit the color schemes included with Sublime.
ANOTHER UPDATE
With the release of nearly all of the default packages on Github, changes have been coming fast and furiously. The old JS syntax has been completely rewritten to include the best parts of JavaScript Next ES6 Syntax, and now is as fully ES6-compatible as can be. A ton of other changes have been made to cover corner and edge cases, improve consistency, and just overall make it better. The new syntax has been included in the (at this time) latest dev build 3111.
If you'd like to use any of the new syntaxes with the current beta build 3103, simply clone the Github repo someplace and link the JavaScript (or whatever language(s) you want) into your Packages directory - find it on your system by selecting Preferences -> Browse Packages.... Then, simply do a git pull in the original repo directory from time to time to refresh any changes, and you can enjoy the latest and greatest! I should note that the repo uses the new .sublime-syntax format instead of the old .tmLanguage one, so they will not work with ST3 builds prior to 3084, or with ST2 (in both cases, you should have upgraded to the latest beta or dev build anyway).
I'm currently tweaking my Neon Color Scheme to handle all of the new scopes in the new JS syntax, but most should be covered already.
I finally found a way to customize the given Themes.
Go to C:\Program Files\Sublime Text 3\Packages and copy + rename Color Scheme - Default.sublime-package to Color Scheme - Default.zip. Afterwards unzip it and copy the Theme, you want to change to %APPDATA%\Sublime Text 3\Packages\User. (In my case, All Hallow's Eve.tmTheme).
Then you can open it with any Text Editor and change / add something, for example for changing this in JavaScript:
<dict>
<key>name</key>
<string>Lang Variable</string>
<key>scope</key>
<string>variable.language</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#FF0000</string>
</dict>
</dict>
This will mark this in JavaScript Files red. You can select your Theme under Preferences -> Color Scheme -> User -> <Your Name>.
Use the PackageResourceViewer plugin installed via Package Control (as mentioned by MattDMo). This allows you to override the compressed resources by simply opening it in Sublime Text and saving the file. It automatically saves only the edited resources to %APPDATA%/Roaming/Sublime Text 3/Packages/ or ~/.config/sublime-text-3/Packages/.
Specific to the op, once the plugin is installed, execute the PackageResourceViewer: Open Resource command. Then select JavaScript followed by JavaScript.tmLanguage. This will open an xml file in the editor. You can edit any of the language definitions and save the file. This will write an override copy of the JavaScript.tmLanguage file in the user directory.
The same method can be used to edit the language definition of any language in the system.
The "this" is already coloured in Javascript.
View->Syntax-> and choose your language to highlight.
This is my recipe
Note: This isn't exactly what OP is asking. These instructions will help you change the colors of items (comments, keywords, etc) that are defined syntax matching rules. For example, use these instructions to change so that all code comments are colored blue instead of green.
I believe the OP is asking how to define this as an item to be colored when found in a JavaScript source file.
Install Package: PackageResourceViewer
Ctrl+Shift+P > [PackageResourceViewer: Open Resource] > [Color Scheme - Default] > [Marina.sublime-color-scheme] (or whichever color scheme you use)
The above command will open a new tab to the file "Marina.sublime-color-scheme".
For me, this file was located in my roaming profile %appdata% (C:\Users\walter\AppData\Roaming\Sublime Text 3\Packages\Color Scheme - Default\) .
However, if I browse to that path in Windows Explorer, [Color Scheme - Default] is not of a child-dir of [Packages] dir. I suspect that PackageResourceViewer is doing some virtualization.
optional step: On the new color-scheme tab: Ctrl+Shift+P > [Set Syntax: JSON]
Search for the rule you want to change. I wanted to make comments be move visible, so I searched for "Comment"
I found it in the "rules" section
"rules":
[
{
"name": "Comment",
"scope": "comment, punctuation.definition.comment",
"foreground": "var(blue6)"
},
Search for the string "blue6": to find the color variable definitions section. I found it in the "variables" section.
Pick a new color using a tool like http://hslpicker.com/ .
Either define a new color variable, or overwrite the color setting for blue6.
Warning: overwriting blue6 will affect all other text-elements in that color scheme which also use blue6 ("Punctuation" "Accessor").
Save your file, the changes will be applied instantly to any open files/tabs.
NOTES
Sublime will handle any of these color styles. Possibly more.
hsla = hue, saturation, lightness, alpha
rgba = red, green, blue, alpha
hsla(151, 100%, 41%, 1)
- last param is the alpha level (transparency) 1 = opaque, 0.5 = half-transparent, 0 = full-transparent
hsl(151, 100%, 41%) - no alpha channel
rgba(0, 209, 108, 1) - rgb with an alpha channel
rgb(0, 209, 108) - no alpha channel

In Notepad++, set background color for file type

When various files types are open at the same time, such as .html, .css and regular .txt files in Notepad++, is it possible to have a different main background color for each file type?
Whenever I change the background color for any theme, language type, Default styles and of course, the Global Override, all in Style Configurator, each and every document tab and type reflects the background color change.
Each language has its own set of color specifiers in the Style Configurator. The text color and syntax highlighting colors seem to remain intact, but the main background color seems to be a global one size fits all affair?
What if I want text files to always be white background with black text but all .html files to be a black background with white text - and have each open at the same time?
I've spent WAAAAY too much time with intelligent trial and error and research. Perhaps I'm trying to do the impossible?
You can't do this on a per-file basis at all.
You can do this on a per-language basis, but there is no language-level override (the "DEFAULT" color entry does not count) like there is for an application-level override (the "Global Override" entry). This means you have to set the same background color manually in all the individual color entries for a given language. It also means if you want to change the background color... you have to change it for all the individual entries for the language.
In addition, since Notepad++ uses a language-based syntax highlighter, this means if you have an internal style sheet within an HTML file and you have different background colors for HTML and for CSS, you'll see two background colors within the same file. There is no way to specify a different color scheme for CSS or JavaScript that is embedded within HTML.
Open your n++ installation folder, go to folder "themes", open your widely used theme file (my is khaki.xml). Find LexerType you want to change (i.e. tcl), add line like one below right after <LexerType...> node:
<WordsStyle name="Default Style" styleID="32" fgColor="5F5F00" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
Reopen n++, go to Style Configurator, select your style, and now when you set Default Style background color, all background (out of text) will change.
Cheers.
I'm guessing most of the answers on this page are out of date - this is now possible in Notepad++ version 8.4.6 at least.
Use the Settings | Style Configurator... menu item.
From here, you have a list of languages on the left, and for each you can select a different Background Colour.
Tip: I use "More Colours..." to create custom colours for a very, very, very pale green or blue. I then have different areas of the same file (PHP, JavaScript, and HTML) highlighted with very subtly different background colours.
-mobailey

Resources