From a487e2f6d713d2ffb9b42b31e247fba68f5f35e4 Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Thu, 15 Sep 2011 13:43:59 +0000 Subject: [PATCH] Adds a new braille routine git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1959 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- applications/fpbrowser/fpbrowser.dpr | 2 +- applications/fpbrowser/fpbrowser.lpi | 4 ++-- applications/fpbrowser/mod_braille.pas | 28 +++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/applications/fpbrowser/fpbrowser.dpr b/applications/fpbrowser/fpbrowser.dpr index f7e50ba9f..5637f3a79 100644 --- a/applications/fpbrowser/fpbrowser.dpr +++ b/applications/fpbrowser/fpbrowser.dpr @@ -25,7 +25,7 @@ uses {$ifdef FPBROWSER_TURBOPOWERIPRO} viewer_ipro, {$endif} - browserviewer, utf8_braille; + browserviewer, mod_braille; begin Application.Initialize; diff --git a/applications/fpbrowser/fpbrowser.lpi b/applications/fpbrowser/fpbrowser.lpi index bd7e5ad81..8ae720696 100644 --- a/applications/fpbrowser/fpbrowser.lpi +++ b/applications/fpbrowser/fpbrowser.lpi @@ -102,9 +102,9 @@ - + - + diff --git a/applications/fpbrowser/mod_braille.pas b/applications/fpbrowser/mod_braille.pas index 75a08907c..f464fd55c 100644 --- a/applications/fpbrowser/mod_braille.pas +++ b/applications/fpbrowser/mod_braille.pas @@ -67,13 +67,39 @@ const {u + acute} chr($be), {u + circumflex} 'TODO', {u + diaeresis} chr($b3), {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; var Count, count_aux, n, n_aux, decr: integer; Braille_string, string_aux: string; num, accented: boolean; dict_p: dictionary_pointer; - begin Braille_string := ''; num := False;