Recent

Author Topic: [SOLVED] All Things SynFacilSyn  (Read 7039 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1260
[SOLVED] All Things SynFacilSyn
« on: August 25, 2019, 07:55:53 pm »
Hi,


Is there any ENGLISH documentaion for SynFacilSyn
All I get in the download is some other language, Spanish?
« Last Edit: August 30, 2019, 04:55:14 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things SynFacilSyn
« Reply #1 on: August 25, 2019, 07:58:30 pm »
eek... some of the sample projects are not in English either.

  :-\
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things SynFacilSyn
« Reply #2 on: August 25, 2019, 09:20:09 pm »
As I play with the samples... its difficult with out English documentation

Attached is a project file

1) I get an error box when the project loads, but can't read it. Something to do with Tokens I assume.
That message must be in the developed pas file because it isn't in unit one.

2) Numbers automatically turn fuchsia color even though I am not specifying it in my code.
Can't find where this is being set as a default

3) All I want to do is highlight red all music chords in between "[ ]"
And make the "[]" white to hide them but still keep it there for spacing issues if I were to remove it.

See screen below and project
« Last Edit: August 25, 2019, 09:28:42 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things SynFacilSyn
« Reply #3 on: August 25, 2019, 09:21:22 pm »
UPDATE, I figured out the fuchsia number.

Had to add this code instead of hlt2

Code: Pascal  [Select][+][-]
  1.  
  2. hlt2 := TSynPHPSyn.Create(self);
  3.   hlt2.KeywordAttribute.Foreground:=clWhite;
  4.   hlt2.CommentAttribute.Foreground:=clGray;
  5.   hlt2.StringAttribute.Foreground:=clRed;
  6.   hlt2.NumberAttri.Foreground:=clBlack; <-- fixed
  7.   ed1.Highlighter := hlt2;
  8.  

updated project - Download project
« Last Edit: August 25, 2019, 09:42:32 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things SynFacilSyn
« Reply #4 on: August 25, 2019, 10:14:26 pm »
Here is the caveat

A chord could be as simple as "Ab" or "[A#]"

to as complex as...  "[A#sus7]"

What I need to get to is.. everything in between the "[]"s will be red.... not the brackets, I want those white
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things SynFacilSyn
« Reply #5 on: August 26, 2019, 12:15:36 am »
This is frustrating.

See screen. Red squares are text that are highlighted and Italicized... I don't even specify these tokens.

So, I am guessing that the developer hard coded the STRING behavior.
The only color I specify is KEYWORD...
Why is keyword RED... I thought keywords are a different attribute than a string

Code: Pascal  [Select][+][-]
  1. hlt2.KeywordAttribute.Foreground:=clRed;
  2.  

Also, the developer has hard-coded the "#" as a comment... and it italicizes
Why?
So, now How can I use a # for anything but a comments or number??
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: All Things SynFacilSyn
« Reply #6 on: August 26, 2019, 12:54:02 am »
I don't know the answers.

But you should give others a chance to provide them, rather than having a conversation with yourself.

synFacilSyn stuff has been answered in the past. The author is on the board, maybe not every day, or maybe on holiday... who knows.

Or if you know you keep working on it, collect your updates, so you can skip a few of those that you figured out yourself.

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: All Things SynFacilSyn
« Reply #7 on: August 26, 2019, 03:04:01 am »
You can make your own HIghlighter. It takes a few steps to fill in the gaps but basically you start with base model that all the highlighters use which give you the items TsynEdit uses.

 SetLine for example passes the line to the highlighter and at which point things like Gettoken will be requested from SynEdit along with The Attributes for it on each item asked for from sync edit.

 Look for examples for this, Its almost impossible to use currently installed highlighters because they all are based around code editors. even the "Any" version does not give the flexibility needed.

 I've done this already but you are not doing what I did so you'll need to get your feet wet and make your own custom filter (high lighter) .

 The only problem you may run into is the difference between Physical and logical locations of the line.

 Look on the net for examples of making a highlighter for TSynEdit;
« Last Edit: August 26, 2019, 03:06:06 am by jamie »
The only true wisdom is knowing you know nothing

Thausand

  • Sr. Member
  • ****
  • Posts: 292
Re: All Things SynFacilSyn
« Reply #8 on: August 26, 2019, 06:38:56 am »
You can make your own HIghlighter. It takes a few steps to fill in the gaps but basically you start with base model that all the highlighters use which give you the items TsynEdit uses.
That not how make power synfacilsyn  :)

SynFacilSyn have power in xml process that make automatic parse and highlight.

Please see example: https://github.com/t-edson/SynFacilSyn/tree/1.21/Sample_Project

Then have good look unit 1, have simple 4 lines create and load synfacil xml highlight: https://github.com/t-edson/SynFacilSyn/blob/1.21/Sample_Project/unit1.pas

Then can make xml file, example Pascal: https://github.com/t-edson/SynFacilSyn/blob/1.21/Sample_Project/ObjectPascal.xml

Documentation explain what is all xml field and how use. English documentation is not complete if compare Spanish. I make suggest use web translate for Spanish documentation. Code/xml example is no difficult read (Spanish or English code/xml is same read  :)).

xml define for SynFacilSyn is only complicate when highlight 'language' is complicate.

Have good luck !

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things SynFacilSyn
« Reply #9 on: August 26, 2019, 02:33:23 pm »
Really...

1) There is no english docs
2) I am using the examples in the download... which doesn't address my particular issues
3) I know how to do tokens/lex... made one in VB.NET that worked.
4) I am already making my own XML...
5) Did you download my project... I have my own code and xml

Don't you people read my posts above.

Just using the most basic XML still doesn't work.
And what about the developers hard-coded code that makes my projects to not look right.



Per dev's readme file, this basic xml doesn't work, the keywords do not highlight

Code: Pascal  [Select][+][-]
  1. <?xml version="1.0"?>
  2. <Language name="LyricsEditor" ext="lyr cho onsong">
  3.    <Keywords>
  4.     every
  5.     Lord
  6.   </Keywords>
  7. </Language>
  8.  
  9.  

pascal code

Code: Pascal  [Select][+][-]
  1.  
  2. hlt2.KeywordAttribute.Foreground:=clRed;
  3.  
:-\

« Last Edit: August 26, 2019, 02:48:00 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things SynFacilSyn
« Reply #10 on: August 26, 2019, 03:01:22 pm »
Tried to translate the Spanish DOC file online... the ones I tried didn't work.

I am not going to take this 205 page text and translate a paragraph at a time.
Don't have that kind of time.

Where is a good site that can handle large translating text and it works?
« Last Edit: August 26, 2019, 03:03:17 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: All Things SynFacilSyn
« Reply #11 on: August 26, 2019, 03:13:48 pm »
Tried to translate the Spanish DOC file online... the ones I tried didn't work.

I am not going to take this 205 page text and translate a paragraph at a time.
Don't have that kind of time.

Where is a good site that can handle large translating text and it works?

If the file you mean is "La Biblia de SynEdit", I'm in the process of translating it (very slowly) to English. If there is some short section you need, tell me which it is; I may be able to provide it ahead of the rest. But it has to be a short section; I'm swamped in work (and with life) at the moment.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things SynFacilSyn
« Reply #12 on: August 26, 2019, 03:25:30 pm »
xml define for SynFacilSyn is only complicate when highlight 'language' is complicate.


@Thausand
Does this library except custom file types.... My xml is just plain text... it's not a language?
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

pixelink

  • Hero Member
  • *****
  • Posts: 1260
Re: All Things SynFacilSyn
« Reply #13 on: August 26, 2019, 03:27:05 pm »
Tried to translate the Spanish DOC file online... the ones I tried didn't work.

I am not going to take this 205 page text and translate a paragraph at a time.
Don't have that kind of time.

Where is a good site that can handle large translating text and it works?

If the file you mean is "La Biblia de SynEdit", I'm in the process of translating it (very slowly) to English. If there is some short section you need, tell me which it is; I may be able to provide it ahead of the rest. But it has to be a short section; I'm swamped in work (and with life) at the moment.


Thanks for the offer , but I don't want to use your time. I can wait until it's done. What I am doing is not critical at this time.
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 2.2.0 •  VSSTUDIO(.Net) 2022 • Win10 • 16G RAM • Nvida GForce RTX 2060

wp

  • Hero Member
  • *****
  • Posts: 11853
Re: All Things SynFacilSyn
« Reply #14 on: August 26, 2019, 05:11:52 pm »
Tried to translate the Spanish DOC file online... the ones I tried didn't work.
I don't know what you did. I called translate.google.com, clicked "Documents", selected translation from Spanish to English and uploaded the "La Biblia de SynEdit.pdf". After a short time, the English version came up, not too bad - hmm, pretty good actually! The translated doc is a html which I downloaded to my disk. It is not good for printing, but good for screen reading. Using 7-zip I was able to squeeze it into the 250KB upload limit of the forum

 

TinyPortal © 2005-2018