2 new revisions: Revision: 51a1f8308188 Branch: default Author: Michael Whapples Date: Wed Jul 30 15:29:24 2014 UTCLog: Fix for boxline characters not being mapped to dots, goes partially to...
http://code.google.com/p/liblouisutdml/source/detail?r=51a1f8308188 Revision: c352a6c462cf Branch: default Author: Michael Whapples Date: Thu Jul 31 09:16:34 2014 UTCLog: Boxlines now appear on a separate line it UTD and thus BRF. Whether bl...
http://code.google.com/p/liblouisutdml/source/detail?r=c352a6c462cf ============================================================================== Revision: 51a1f8308188 Branch: default Author: Michael Whapples Date: Wed Jul 30 15:29:24 2014 UTCLog: Fix for boxline characters not being mapped to dots, goes partially to fixing brf boxline issue
http://code.google.com/p/liblouisutdml/source/detail?r=51a1f8308188 Modified: /lbu_files/utd.sem /liblouisutdml/semantics.c /liblouisutdml/transcriber.c /liblouisutdml/utd2brf.c ======================================= --- /lbu_files/utd.sem Wed Jun 26 00:06:46 2013 UTC +++ /lbu_files/utd.sem Wed Jul 30 15:29:24 2014 UTC @@ -6,6 +6,7 @@ utdmeta meta,name,utd utdbrl brl utdbrlonly span,class,brlonly +#utdbrlonly brl,type,brlonly utdnewpage newpage,brlnumber utdnewline newline,xy utddispimg xxx ======================================= --- /liblouisutdml/semantics.c Wed Jun 18 09:23:57 2014 UTC +++ /liblouisutdml/semantics.c Wed Jul 30 15:29:24 2014 UTC @@ -1228,9 +1228,15 @@ { HashEntry *nodeEntry = (HashEntry *) node->_private; if (nodeEntry != NULL) + {+ logMessage(LOG_DEBUG, "Node %s has nodeEntry", (const char *)node->name);
return nodeEntry->semNum; + } else + {+ logMessage(LOG_DEBUG, "Node %s has no nodeEntry", (const char *)node->name);
return no; + } } unsigned char * ======================================= --- /liblouisutdml/transcriber.c Fri Jul 25 17:34:58 2014 UTC +++ /liblouisutdml/transcriber.c Wed Jul 30 15:29:24 2014 UTC @@ -3521,6 +3521,7 @@ int k; int availableCells = 0; widechar wTmpBuf = (widechar)boxChar[0]; + widechar dots; if (ud->format_for == utd) return utd_addBoxline(boxChar, beforeAfter); logMessage(LOG_DEBUG, "Begin addBoxline"); @@ -3531,9 +3532,11 @@ availableCells = startLine(); } logMessage(LOG_DEBUG, "availableCells=%d", availableCells); + if (!lou_charToDots(ud->main_braille_table, &wTmpBuf, &dots, 1, 0)) + return 0; for (k = 0; k < availableCells; k++) { - ud->outbuf1[k+ud->outbuf1_len_so_far] = wTmpBuf; + ud->outbuf1[k+ud->outbuf1_len_so_far] = dots; } ud->outbuf1_len_so_far += availableCells; cellsWritten += availableCells; @@ -3553,6 +3556,7 @@ xmlNode *lineNode; xmlNode *textNode; widechar wTmpBuf = (widechar)boxChar[0]; + widechar dots; widechar *lineBuf; char *chContent; // Make sure that styleSpec relates to a node @@ -3565,20 +3569,24 @@ while (availableCells != ud->cells_per_line) { utd_finishLine(0, 0); - availableCells = utd_startLine(); + availableCells = utd_startLine(); } + // Get the dots representation for the boxline character + if (!lou_charToDots(ud->main_braille_table, &wTmpBuf, &dots, 1, 0)) + return 0; // Create the line of characters lineBuf = malloc(inlen); chContent = malloc(outlen); for (k = 0; k < availableCells; k++) { - lineBuf[k] = wTmpBuf; + lineBuf[k] = dots; } inlen = availableCells; wc_string_to_utf8(lineBuf, &inlen, chContent, &outlen); // Create new brl node at the start of the styled node lineNode = xmlNewNode(NULL, (xmlChar *)"brl"); textNode = xmlNewText(chContent);+ xmlSetProp(lineNode, (const xmlChar *)"type", (const xmlChar *)"brlonly");
xmlAddChild(lineNode, textNode); free(lineBuf); free(chContent); ======================================= --- /liblouisutdml/utd2brf.c Wed Oct 2 03:55:47 2013 UTC +++ /liblouisutdml/utd2brf.c Wed Jul 30 15:29:24 2014 UTC @@ -83,6 +83,7 @@ case utdmeta: return 1; case utdbrl: + logMessage(LOG_DEBUG, "Processing brl node"); brf_doBrlNode (node, 0); pop_sem_stack (); return 1; @@ -124,14 +125,18 @@ static int brf_doDotsText (xmlNode * node) { + logMessage(LOG_DEBUG, "brf_doDotsText %s", node->content); ud->text_length = 0; insert_utf8 (node->content); if ((ud->outbuf1_len_so_far + ud->text_length) > ud->outbuf1_len) brf_saveBuffer (); + logMessage(LOG_DEBUG, "text_buffer: %s", ud->text_buffer); if (!lou_dotsToChar (ud->main_braille_table, ud->text_buffer, &ud->outbuf1[ud->outbuf1_len_so_far], ud->text_length, 0)) return 0; + logMessage(LOG_DEBUG, "ud->textLength %d", ud->text_length);+ logMessage(LOG_DEBUG, "ud->outbuf1: %s", &ud->outbuf1[ud->outbuf1_len_so_far+1]);
ud->outbuf1_len_so_far += ud->text_length; return 1; } ============================================================================== Revision: c352a6c462cf Branch: default Author: Michael Whapples Date: Thu Jul 31 09:16:34 2014 UTCLog: Boxlines now appear on a separate line it UTD and thus BRF. Whether blank line handling is correct is still for discussion.
http://code.google.com/p/liblouisutdml/source/detail?r=c352a6c462cf Modified: /liblouisutdml/transcriber.c ======================================= --- /liblouisutdml/transcriber.c Wed Jul 30 15:29:24 2014 UTC +++ /liblouisutdml/transcriber.c Thu Jul 31 09:16:34 2014 UTC @@ -3559,21 +3559,24 @@ widechar dots; widechar *lineBuf; char *chContent; + // Dots representation of the boxline character + if (!lou_charToDots(ud->main_braille_table, &wTmpBuf, &dots, 1, 0)) + return 0; // Make sure that styleSpec relates to a node if (styleSpec->node == NULL) return 0; logMessage(LOG_DEBUG, "Begin utd_addBoxline"); // We should catch the current brlNode so we can restore afterwards tmpBrlNode = brlNode; + // Create the brl node for the boxline + lineNode = xmlNewNode(NULL, (const xmlChar *)"brl"); + brlNode = lineNode; // Find a complete blank line while (availableCells != ud->cells_per_line) { utd_finishLine(0, 0); availableCells = utd_startLine(); } - // Get the dots representation for the boxline character - if (!lou_charToDots(ud->main_braille_table, &wTmpBuf, &dots, 1, 0)) - return 0; // Create the line of characters lineBuf = malloc(inlen); chContent = malloc(outlen); @@ -3584,7 +3587,7 @@ inlen = availableCells; wc_string_to_utf8(lineBuf, &inlen, chContent, &outlen); // Create new brl node at the start of the styled node - lineNode = xmlNewNode(NULL, (xmlChar *)"brl"); + // lineNode = xmlNewNode(NULL, (xmlChar *)"brl"); textNode = xmlNewText(chContent);xmlSetProp(lineNode, (const xmlChar *)"type", (const xmlChar *)"brlonly");
xmlAddChild(lineNode, textNode); @@ -3602,6 +3605,7 @@ { brlNode = xmlAddChild(styleSpec->node, lineNode); } + utd_finishLine(0, 0); // Restore original brlNode brlNode = tmpBrlNode; logMessage(LOG_DEBUG, "Finish utd_addBoxline"); For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com