Why can't I apply scheme to codeblocks - codeblocks

I change my default.conf by
http://wiki.codeblocks.org/index.php?title=Syntax_highlighting_custom_colour_themes
But when I want to change my scheme, it shows me
Loading lexer_vhdl
Loading lexer_xml
SpellChecker: Thesaurus files
D:\CodeBlocks\share\codeblocks\SpellChecker\th_en_US.idx' not found!
And the color didn't change. I don't know what problem it is.

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.

What is the format "BM6"?

I am working with an old system of palletes. When I export an image, it also creates an pallete with 15/16 colors. But when I try to replicate the same result, the program does not recognize the image which I just created. To analyse what happened, I opened some images with notepad and compared them with my "creation" and I noticed quite some differences.
But the most interesting thing was that at the beginning of my images' code was the type "BM6", while they should be "png" or "bmp". I think that is some thing of codification, but I cannot find anything about it.
If the image file is properly formed, then you can take your .bm6 file and simple change / rename the extension to .bmp. And it should suddenly be an image.
.bm6 can result from creating an image file using a text editor, as seen here.

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

BitmapFont in Skin doesn't draw labels correctly

I made a bitmap font using Hiero, called default.fnt and default.png. I can use these as a BitmapFont in LibGDX, and draw text with the font without problems, using font.draw(). But I can't use this font as the default font in a Skin. I've used the uiskin.json file from here(along with the rest of the skin, but I deleted the Droid Sans files before making my own font), because I have no idea how to make one of my own. From what I've read on the Internet, the .json file is correctly set up: it has the line com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: default.fnt } }, which should make the default.fnt the default font for widgets that use the skin. Still, when I run the program, I see this:
There should be a label above the buttons, and the buttons should have text.
If I do this: startGameButton.getStyle().font = font;, where startGameButton is one of the buttons, and font is the BitmapFont created like this: font = new BitmapFont(Gdx.files.internal("uiskin/default.fnt"), Gdx.files.internal("uiskin/default.png"), false);, the buttons shows the text properly. I don't want to do this since it feels too much like a hack.
I'm following this tutorial, but I've had to look some things up in later revisions of his code, because LibGDX has changed since it was written.
MenuScreen.java(the screen where there are problems)
AbstractScreen.java
Also please tell me if there's a better way to make the menu UI, or if you need other files. The uiskin.json is linked above.
Thank you.
I fixed it. The Droid Sans bitmap image existed in two places, it was part of uiskin.png too. I don't know how, but it probably read the font's letters from that file instead of default.png. So in the end I just renamed the font's .fnt and .png(and the file parameter in the .fnt) and did a search-replace inside the skin's .json, and it all works fine now. I don't know exactly what caused it, but maybe default-font is a reserved word or something.
Anyway, it works now. Thanks to Jyro117 for making me think maybe I shouldn't replace the default but add my own font.

Thumbnail-like behavior using target attribute of image directive

I use Sphinx to generate some docs. I have a reStructuredText document and I'd like to put an image into it. The case is that the image should be clickable so that after a user clicks the image then they should be shown this image in full size. I use the image directive and its target option like this:
.. image:: /images/some_image.png
:alt: Image descripion
:align: center
:target: `big_some_image`_
.. _big_some_image: /images/some_image.png
The problem is that in the rendered page I get:
<img src="../../../_images/some_image.png">
So there is correct src from the image directive but an incorrect href attribute from the hyperlink.
Questions:
is there any way to generate links in the way that image directive does it? I mean relative to the document.
is there any other (built in) way to have "thumbnail-> click -> big image" behaviour?
Simply use the scale option:
.. image:: large_image.png
:scale: 20%
When the scaled image is clicked on, the full image loads in its own window. So this doesn't increase the image size on the page, but that would be messy anyway.
When you use the image directive from within Sphinx, Sphinx does some special handling to find the image file and copy it into your project (like your _images directory), and then renders the HTML to point to that place.
But the target option just takes a URL as a parameter. It knows nothing about your Sphinx project, or how your images are laid out, and does not attempt to guess.
If you want to have it point to a larger version of the same file, you will likely need to do some manual steps (like maybe copying the file to a specific location), or maybe provide a relative URL to the large file, rather than the absolute URL you have in your example.
If you want to go a completely different way, you could also try overriding and modifying the HTML templates for your project to add some JavaScript to get the click-to-larger-image effect you want.
Looks like there is a Sphinx extension that does this now, and quite nicely at that, sphinxcontrib-fancybox 0.3.2. Install with pip, add it to your extensions in conf.py, and use the fancybox directive:
.. fancybox:: images/image.png
Relative links seem to work. For the Mapserver docs setup, if an image is placed in the images directory, a relative link like in the following code works in my local build. Here is an example using figure (the underscore ("_") before "images" in the target link is necessary):
.. figure:: ../../images/carto-elements.png
:height: 400
:width: 600
:align: center
:target: ../../_images/symcon-overlay.png

Resources