Forum - Info Center - Eltima Software

Eltima Help Center => Virtual Serial Port Driver & Virtual Serial Port ActiveX => Topic started by: pllow on June 10, 2013, 05:07:43 AM

Title: Get data font on virtual serial port
Post by: pllow on June 10, 2013, 05:07:43 AM
Hi,

I current testing eltima virtual serial port. I have some problem on how to get the font from the buffer.
Sample code from eltima.

  Private Sub AxVSPortAx1_OnRxChar(ByVal sender As Object, ByVal e As AxVSPortLib._IVSPortAxEvents_OnRxCharEvent) Handles AxVSPortAx1.OnRxChar
        Dim Buff() As Byte
        Dim ReceivedCnt As Long

        Buff = AxVSPortAx1.ReadArray(e.count)
        ReceivedCnt = UBound(Buff) + 1

        If ReceivedCnt <> 0 Then
            AddLog(Convert.ToString(ReceivedCnt) & " byte(s) read ")
            AddLogData(Buff, ReceivedCnt)
            RecvBytes = RecvBytes + ReceivedCnt
            lblReceive.Text = Convert.ToString(RecvBytes)

            If Redirect Then
                AxVSPortAx2.WriteArray(Buff)
            End If
        End If
    End Sub

    Private Function AddLogData(ByVal Buf() As Byte, ByVal Size As Long) As Integer
        Dim i As Integer
        For i = 0 To Size - 1
            txtEditTerminal.AppendText(Convert.ToChar(Buf(i)))
        Next i
    End Function

How could we know the Buf() is using what font & size?
I need this as alignment on screen may lost if wrong font applied.

thanks
Title: Re: Get data font on virtual serial port
Post by: alexander-britt on June 10, 2013, 12:22:55 PM
Quote
How could we know the Buf() is using what font & size?
Sorry, what font and size do you mean?

In serial communications the data is transmitted as a sequence of bits. Whether this data is then handled as binary or ASCII, saved to a file or displayed on-screen in a certain way - all this is completely up to the application that handles this data.
Title: Re: Get data font on virtual serial port
Post by: pllow on September 24, 2013, 09:57:13 AM
Ok.Thanks.

The font and size is refer you font use for a character, same as the size. How big the character.

For eg: In notepad, we use font Tohama with font size 18