HighLight plugin

Discuss and announce AkelPad plugins
Locked
  • Author
  • Message
Offline
Posts: 5
Joined: Thu Apr 24, 2008 10:45 am

Post by Black_Sun »

А есть у кого подсветка C# c sharp ?

Offline
Posts: 24
Joined: Tue Nov 13, 2007 5:55 am
Location: Voronezh
Contact:

Post by saym101 »

А где можно почитать про новый формат? Что, Как, Где. Как переделать старый на новый? Чтобы описание было на одном месте. По топику лазить, нечего не понятно.
Спасибо.

Offline
Posts: 147
Joined: Fri Feb 08, 2008 6:41 pm
Location: British Columbia, Canada

Highlight - block comments (quotes)

Post by Surveyor »

Instructor,

I am always using the HighLight plugin for JavaScript programming, but I notice that block quotes are not handled properly if they contain line endings.

Code: Select all

/* This is line 1. This works if it is a single line */

Code: Select all

/* This is line 1.
This is line 2.  This method does not work, since it contains a line ending. */
Is this a bug in HighLight plugin? Or do we need a new flag, such as:
2048 ignore line endings?

I have tried various flag settings, but no luck. :(

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

Surveyor
For now supported only single line highlighting.

DV
Offline
Posts: 1250
Joined: Thu Nov 16, 2006 11:53 am
Location: Kyiv, Ukraine

Post by DV »

Что-то не могу въехать: как для bat-файлов правильно настроить комментарий REM? Сейчас упорно подсвечивает не только

Code: Select all

REM
с последующим текстом, но и, к примеру, слово

Code: Select all

remove
. Путём колдовством с битовыми флагами ( :) ) удалось добиться только такого: remove. А как указать, что после rem обязательно должен быть разделитель, иначе это не является "Quotes"?

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

DV

Code: Select all

;512=512
512	3	#008000	0	"REM "	""	""
;512=512
512	3	#008000	0	"REM	"	""	""

Offline
Posts: 2247
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

:)

Post by FeyFre »

DV, я c Вами во секрету поделюсь, что rem не я вляется комменатрием, только "::" rem - внутренняя команда интерпретатора а не конструкция языка, о чем свидетельствует реакция на "rem /?" :)

Offline
Posts: 147
Joined: Fri Feb 08, 2008 6:41 pm
Location: British Columbia, Canada

Courier New "problem"

Post by Surveyor »

Instructor,

I apologize in advance for the long post - I just want to be clear. I have searched the Internet for a font similar to Courier New which does not show the bad behavior in italics (underscore disappears), and have found some, but none are as clear as Courier New.

---------------------------------------

This post follows a post made by Infocatcher on Apr 26, 2009. Unfortunately for me, the conversation was in Russian, but Google translate provides some help.
Infocatcher wrote:Короче говоря, подчеркивания (которые _) исчезают из блоков, выделенных курсивом.
English -> In short, the underscore (_ to) disappear from the blocks in italics.
Your reply, although probably accurate, was not understandable to me mostly due to the the Russian -> English translation.

Anyway, if the HighLight template is modified (eg. js.highlight) to show bold italics (instead of just normal italics), underscore characters are visible! I believe that you spoke of this in your previous conversation. However, if an underscore character is used in typing such that the HighLight plugin does not modify it, as in

Code: Select all

// Underscore_here (hidden)
var Underscore_also_here //(visible)
and the display font is set to Courier New italic (View/Font.../Font style), then the underscore is visible!:D

Another interesting behavior:
  1. set font to Courier New, huge size (48?)
  2. make sure HighLight plugin is running
  3. use above Code (comment with underscore) in a .JS file so that HighLight will affect it
  4. select text - underscore is visible! This can be made easier to see by changing color of selected text to red (using View/Colors...)
In short, it appears (to me) that there is nothing wrong with Courier New italic font, but the HighLight plugin must be handling it in some way which alters the italic display.

For now, I will use a different (monospace) font ("ProggyClean TT"), but perhaps something is wrong with the HighLight plugin in italic handling. A color thing?

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

Surveyor
AkelEdit all calculations make with basic font. Courier New normal and italic have different height.

ENG: Courier New with a little raised underscore in italic styles.
РУС: Courier New с немного поднятым символом подчёркивания в курсивных стилях.
http://akelpad.sourceforge.net/files/pl ... NewMod.zip
Last edited by Instructor on Fri Nov 27, 2009 10:43 pm, edited 1 time in total.

Offline
Posts: 1862
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

Instructor wrote:ENG: Courier New with a little raised underscore in italic styles.
РУС: Courier New с немного поднятым символом подчёркивания в курсивных стилях.
http://akelpad.sourceforge.net/files/pl ... NewMod.zip
А можно сделать возможность использования шрифта, не установленного в системе, – для запуска AkelPad'а с флэшки?
И не проще ли использовать наибольшую высоту (из всех возможных написаний выбранного шрифта) при расчетах в AkelEdit?

Eng: It is possible to use not installed font for using AkelPad as portable (from flash drive)?
And it is not easier to use greatest height (from all styles of selected font) for calculations in AkelEdit?

(and sorry for my ugly English :D)

Offline
Posts: 147
Joined: Fri Feb 08, 2008 6:41 pm
Location: British Columbia, Canada

Thanks!!

Post by Surveyor »

Instructor,
Instructor wrote:AkelEdit all calculations make with basic font. Courier New normal and italic have different height.
Courier New with a little raised underscore in italic styles.
http://akelpad.sourceforge.net/files/to ... NewMod.zip
:idea: :arrow: :D The light shines! (I understand)

Many thanks for the font - this is perfect! (but I don't know where you found it - I searched hi and low...)

-------------------------------------------------------------------------------
Infocatcher wrote:It is possible to use not installed font for using AkelPad as portable (from flash drive)?
I think that in order to use fonts properly, they must be "installed" on the Windows system. You may carry your fonts with you on a flash drive, but you must (?) then "install" them to the Windows\Fonts folder in order to allow the Windows sysem (and AkelPad) to find them.

As for modifying the AkelPad code, I imagine that there are many variations with fonts. I have searched for fonts (lately and in the past) and have seen thousands (or more?) on the Internet. I know also that sizing is not uniform with fonts; 12pt (for example) is huge on some, but too small on others.

And, your English is fine! If you want to see "ugly English" you should see the Google translations from Russian - hilarious!

Offline
Posts: 876
Joined: Tue Jul 24, 2007 8:54 am

Post by Fr0sT »

I think that in order to use fonts properly, they must be "installed" on the Windows system. You may carry your fonts with you on a flash drive, but you must (?) then "install" them to the Windows\Fonts folder in order to allow the Windows sysem (and AkelPad) to find them.
AddFontResource
The AddFontResource function adds the font resource from the specified file to the system font table. The font can subsequently be used for text output by any application.

To mark a font as private or no enumerable, use the AddFontResourceEx function.

int AddFontResource(
LPCTSTR lpszFilename // font file name
);

Return Values
If the function succeeds, the return value specifies the number of fonts added.

If the function fails, the return value is zero. No extended error information is available.

Remarks
Any application that adds or removes fonts from the system font table should notify other windows of the change by sending a WM_FONTCHANGE message to all top-level windows in the operating system. The application should send this message by calling the SendMessage function and setting the hwnd parameter to HWND_BROADCAST.

When an application no longer needs a font resource that it loaded by calling the AddFontResource function, it must remove that resource by calling the RemoveFontResource function.

This function installs the font only for the current session. When the system restarts, the font will not be present. To have the font installed even after restarting the system, the font must be listed in the registry.

Windows 95/98/Me: AddFontResourceW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.

Requirements
Windows NT/2000/XP/Vista: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP. Also supported by Microsoft Layer for Unicode.

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

Surveyor wrote:(but I don't know where you found it - I searched hi and low...)
If you can't find something, make it yourself :)
Infocatcher wrote:А можно сделать возможность использования шрифта, не установленного в системе, – для запуска AkelPad'а с флэшки?
Eng: It is possible to use not installed font for using AkelPad as portable (from flash drive)?
См. Fonts plugin.

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

Changed: AkelPad 4.2.4 required.

Added: new flags:
  • 2048 quote start is surrounded with delimiters ("Quotes:" section only).
    4096 quote end is surrounded with delimiters ("Quotes:" section only).
Added: perl syntax file.

Fixed: escape char before quote start didn't working.
Fixed: external call for mark/unmark (MDI).


HighLight plugin v4.4

Offline
Posts: 35
Joined: Mon Jun 15, 2009 3:46 pm

Post by ccaid »

Мои предложения по Highlight (разной степени тяжести :) ):
1) xml.highlight: добавить расширение fb2 (полагаю, комментарии не требуются)
2) требуется для ini.highlight следующая конструкция:
quote начинается с начала строки и заканчивается, не включая, знаком равно
вот такое определение не работает:
;773=1+4+256+512
773 1 #00cccc 0 "" "=" ""
то ли конструкция определена неверно, то ли вообще не предусмотрена
3) добавление и коррекция в ini.highlight:
(комментарии справа отсутствуют в файле, предназначены для сообщения)

Code: Select all

Quotes:
;513=1+512
513	2	#CC3333	0	"REGEDIT4"	""	""
;513=1+512
513	2	#CC3333	0	"Windows Registry Editor Version 5.00"	""	""
;1=1
1	3	#008000	0	";"	""	""  ;комментарии в ini, reg и т.д. не обязаны начинаться с начала строки
;773=1+4+256+512
773	1	#CC3333	0	""	"="	""  ;это вышеупомянутая проблема
;517=1+4+512
517	1	#CC3333	0	`"`	`"`	"\" ;частичное решение проблемы, работает для reg
;5=1+4
5	3	#808080	0	`"`	`"`	"\" ;подсветим string
Delimiters:
1	0	#CC3333	0	=                   ;цвет разделителей, как в других *.highlight
1	0	#CC3333	0	:                   ;в reg это популярный разделитель
Words:
1	0	#339933	0	dword               ;это для reg
1	0	#339933	0	hex                 ;
4) использовать константы для обозначения цветов, константы определять:
либо в том же файле, где используются,
либо в отдельном – общем для всех файлов *.highlight (welcome цветовые схемы),
либо разрешить оба варианта (несколько противоречит идее цветовых схем, но свобода дороже догматов :) )
Locked