Adds a new braille routine

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1959 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-09-15 13:43:59 +00:00
parent dfa22a28e5
commit a487e2f6d7
3 changed files with 30 additions and 4 deletions

View File

@ -25,7 +25,7 @@ uses
{$ifdef FPBROWSER_TURBOPOWERIPRO} {$ifdef FPBROWSER_TURBOPOWERIPRO}
viewer_ipro, viewer_ipro,
{$endif} {$endif}
browserviewer, utf8_braille; browserviewer, mod_braille;
begin begin
Application.Initialize; Application.Initialize;

View File

@ -102,9 +102,9 @@
<UnitName Value="viewer_ipro"/> <UnitName Value="viewer_ipro"/>
</Unit9> </Unit9>
<Unit10> <Unit10>
<Filename Value="utf8_braille.pas"/> <Filename Value="mod_braille.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="utf8_braille"/> <UnitName Value="mod_braille"/>
</Unit10> </Unit10>
</Units> </Units>
</ProjectOptions> </ProjectOptions>

View File

@ -67,13 +67,39 @@ const
{u + acute} chr($be), {u + circumflex} 'TODO', {u + diaeresis} chr($b3), {u + acute} chr($be), {u + circumflex} 'TODO', {u + diaeresis} chr($b3),
{y + acute} 'TODO', {thorn} 'TODO', {y + diaeresis} 'TODO'); {y + acute} 'TODO', {thorn} 'TODO', {y + diaeresis} 'TODO');
function ConvertUTF8CharacterToBraille(AInput: string): string;
begin
end;
function ConvertUTF8TextToBrailleNew(AInput: string): string;
var
lInput: PChar;
lPos: Integer;
lCharSize: Integer;
lCurChar: string;
begin
Result := '';
lInput := PChar(AInput);
lPos := 0;
while lPos < Length(AInput) do
begin
lCharSize := LCLProc.UTF8CharacterLength(lInput);
SetLength(lCurChar, lCharSize);
Move(lCurChar[1], lInput^, lCharSize);
Result := Result + ConvertUTF8CharacterToBraille(lCurChar);
Inc(lInput, lCharSize);
Inc(lPos, lCharSize);
end;
end;
function ConvertUTF8TextToBraille(Line: string): string; function ConvertUTF8TextToBraille(Line: string): string;
var var
Count, count_aux, n, n_aux, decr: integer; Count, count_aux, n, n_aux, decr: integer;
Braille_string, string_aux: string; Braille_string, string_aux: string;
num, accented: boolean; num, accented: boolean;
dict_p: dictionary_pointer; dict_p: dictionary_pointer;
begin begin
Braille_string := ''; Braille_string := '';
num := False; num := False;